Sha256: eb07fd6e2386c0c45faef5bf6d05a6cd3a551c4c4f97d728086bcf21ff564fde
Contents?: true
Size: 693 Bytes
Versions: 33
Compression:
Stored size: 693 Bytes
Contents
require 'intercom/utils' module Intercom module ApiOperations module Find 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(collection_class) if params[:id] id = params.delete(:id) response = @client.get("/#{collection_name}/#{id}", params) else response = @client.get("/#{collection_name}", params) end raise Intercom::HttpError.new('Http Error - No response entity returned') unless response from_api(response) end end end end
Version data entries
33 entries across 33 versions & 1 rubygems