Sha256: 39ac99ca60ed9656cb98545f93bb082d0c0aef4d5720a20a6ade44fda6fb3432

Contents?: true

Size: 554 Bytes

Versions: 33

Compression:

Stored size: 554 Bytes

Contents

require 'intercom/utils'

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

33 entries across 33 versions & 1 rubygems

Version Path
intercom-3.9.5 lib/intercom/api_operations/load.rb
intercom-3.9.4 lib/intercom/api_operations/load.rb
intercom-3.9.3 lib/intercom/api_operations/load.rb
intercom-3.9.2 lib/intercom/api_operations/load.rb
intercom-3.9.0 lib/intercom/api_operations/load.rb
intercom-3.8.1 lib/intercom/api_operations/load.rb
intercom-3.8.0 lib/intercom/api_operations/load.rb
intercom-3.7.7 lib/intercom/api_operations/load.rb
intercom-3.7.6 lib/intercom/api_operations/load.rb
intercom-3.7.5 lib/intercom/api_operations/load.rb
intercom-3.7.4 lib/intercom/api_operations/load.rb
intercom-3.7.3 lib/intercom/api_operations/load.rb
intercom-3.7.2 lib/intercom/api_operations/load.rb
intercom-3.7.1 lib/intercom/api_operations/load.rb
intercom-3.7.0 lib/intercom/api_operations/load.rb
intercom-3.6.2 lib/intercom/api_operations/load.rb
intercom-3.6.1 lib/intercom/api_operations/load.rb
intercom-3.6.0 lib/intercom/api_operations/load.rb
intercom-3.5.26 lib/intercom/api_operations/load.rb
intercom-3.5.25 lib/intercom/api_operations/load.rb