Method: Appfirst::Collection#get

Defined in:
lib/appfirst/collection.rb

#get(id) ⇒ Object



28
29
30
31
32
33
34
35
36
# File 'lib/appfirst/collection.rb', line 28

def get(id)
  if data = connection.send(self.model_request, "id" => id).body[self.model_root]
    new(data)
  else
    nil
  end
rescue Appfirst::Response::NotFound
  nil
end