Method: Point::Base.find_single
- Defined in:
- lib/point/base.rb
.find_single(id, params = {}) ⇒ Object
Find a single object and return an object for it.
41 42 43 44 45 46 47 48 |
# File 'lib/point/base.rb', line 41 def find_single(id, params = {}) o = JSON.parse(Request.new(member_path(id, params)).make.output) if o[class_name.downcase] create_object(o[class_name.downcase], params) else raise Point::Errors::NotFound, "Record not found" end end |