Module: Oshpark::RemoteModel::ClassMethods

Defined in:
lib/oshpark/remote_model.rb

Instance Method Summary collapse

Instance Method Details

#allObject



30
31
32
33
34
# File 'lib/oshpark/remote_model.rb', line 30

def all
  Oshpark::client.public_send(object_names)[object_names].map do |json|
    self.from_json json
  end
end

#find(id) ⇒ Object



36
37
38
# File 'lib/oshpark/remote_model.rb', line 36

def find id
  self.from_json(Oshpark::client.public_send(object_name, id)[object_name])
end