Sha256: f4586f53cdf05526373be04ee9f3b09c99867f7faaab43e066977b4b3721a8df
Contents?: true
Size: 638 Bytes
Versions: 8
Compression:
Stored size: 638 Bytes
Contents
# frozen_string_literal: true 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 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, 'Http Error - No response entity returned' unless response from_api(response) end end end end
Version data entries
8 entries across 8 versions & 1 rubygems