Module: Intercom::ApiOperations::Find::ClassMethods
- Defined in:
- lib/intercom/api_operations/find.rb
Instance Method Summary collapse
Instance Method Details
#find(params) ⇒ Object
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/intercom/api_operations/find.rb', line 5 def find(params) raise BadRequestError, "#{self}#find takes a hash as its parameter but you supplied #{params.inspect}" unless params.is_a? Hash collection_name = Utils.resource_class_to_collection_name(self) if params[:id] response = Intercom.get("/#{collection_name}/#{params[:id]}", {}) else response = Intercom.get("/#{collection_name}", params) end from_api(response) end |