class ObjectJSONMapper::Associations::HasOne

Public Instance Methods

call(object) click to toggle source

@param object [ObjectJSONMapper::Base] @return [ObjectJSONMapper::Base]

# File lib/object_json_mapper/associations/has_one.rb, line 6
def call(object)
  attributes = object[name]
  attributes ||= HTTP.parse_json(object.client[endpoint].get.body)

  klass.persist(attributes)
end