Sha256: 9cdca4befbc36d67385494546308fda0be352cf959785cbe1ba01c3d220fb3b4

Contents?: true

Size: 390 Bytes

Versions: 16

Compression:

Stored size: 390 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
        from_response(response)
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
intercom-2.2.4 lib/intercom/api_operations/load.rb
intercom-2.2.3 lib/intercom/api_operations/load.rb
intercom-2.2.2 lib/intercom/api_operations/load.rb
intercom-2.2.1 lib/intercom/api_operations/load.rb
intercom-2.2.0 lib/intercom/api_operations/load.rb
intercom-2.1.6 lib/intercom/api_operations/load.rb
intercom-2.1.5 lib/intercom/api_operations/load.rb
intercom-2.1.4 lib/intercom/api_operations/load.rb
intercom-2.1.3 lib/intercom/api_operations/load.rb
intercom-2.1.2 lib/intercom/api_operations/load.rb
intercom-2.1.1 lib/intercom/api_operations/load.rb
intercom-2.1.0 lib/intercom/api_operations/load.rb
intercom-2.0.3 lib/intercom/api_operations/load.rb
intercom-2.0.2 lib/intercom/api_operations/load.rb
intercom-2.0.1 lib/intercom/api_operations/load.rb
intercom-2.0.0 lib/intercom/api_operations/load.rb