Sha256: a6282ce7a30ef5725fa26aee61ccb1339c851dd21dd4a41897cbac24f4870531

Contents?: true

Size: 528 Bytes

Versions: 20

Compression:

Stored size: 528 Bytes

Contents

module Intercom
  module ApiOperations
    module Load
      def load(object)
        collection_name = Utils.resource_class_to_collection_name(collection_class)
        if object.id
          response = @client.get("/#{collection_name}/#{object.id}", {})
        else
          raise "Cannot load #{collection_class} as it does not have a valid id."
        end
        raise Intercom::HttpError.new('Http Error - No response entity returned') unless response
        object.from_response(response)
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
intercom-3.5.9 lib/intercom/api_operations/load.rb
intercom-3.5.8 lib/intercom/api_operations/load.rb
intercom-3.5.7 lib/intercom/api_operations/load.rb
intercom-3.5.6 lib/intercom/api_operations/load.rb
intercom-3.5.5 lib/intercom/api_operations/load.rb
intercom-3.5.4 lib/intercom/api_operations/load.rb
intercom-3.5.3 lib/intercom/api_operations/load.rb
intercom-3.5.2 lib/intercom/api_operations/load.rb
intercom-3.5.1 lib/intercom/api_operations/load.rb
intercom-3.4.0 lib/intercom/api_operations/load.rb
intercom-3.3.0 lib/intercom/api_operations/load.rb
intercom-3.2.0 lib/intercom/api_operations/load.rb
intercom-3.1.0 lib/intercom/api_operations/load.rb
intercom-3.0.6 lib/intercom/api_operations/load.rb
intercom-3.0.5 lib/intercom/api_operations/load.rb
intercom-3.0.4 lib/intercom/api_operations/load.rb
intercom-3.0.3 lib/intercom/api_operations/load.rb
intercom-3.0.2 lib/intercom/api_operations/load.rb
intercom-3.0.0 lib/intercom/api_operations/load.rb
intercom-3.0.0b1 lib/intercom/api_operations/load.rb