Sha256: 00410e0333aa065b3f6761b725e60fdc32fc6bc0d9065d1eaeea22bd3db04215

Contents?: true

Size: 488 Bytes

Versions: 8

Compression:

Stored size: 488 Bytes

Contents

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

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
cogniteev-intercom-2.5.4 lib/intercom/api_operations/load.rb
intercom-2.5.4 lib/intercom/api_operations/load.rb
intercom-2.4.4 lib/intercom/api_operations/load.rb
intercom-2.4.3 lib/intercom/api_operations/load.rb
intercom-2.4.2 lib/intercom/api_operations/load.rb
intercom-2.4.1 lib/intercom/api_operations/load.rb
intercom-2.4.0 lib/intercom/api_operations/load.rb
intercom-2.3.0 lib/intercom/api_operations/load.rb