Class: Io::Flow::V0::Models::ExperienceReference

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ ExperienceReference

Returns a new instance of ExperienceReference.



12278
12279
12280
12281
12282
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12278

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:id], 'ExperienceReference')
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
end

Instance Attribute Details

#id ⇒ Object (readonly)

Returns the value of attribute id.



12276
12277
12278
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12276

def id
  @id
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



12288
12289
12290
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12288

def copy(incoming={})
  ExperienceReference.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#to_hash ⇒ Object



12292
12293
12294
12295
12296
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12292

def to_hash
  {
    :id => id
  }
end

#to_json ⇒ Object



12284
12285
12286
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12284

def to_json
  JSON.dump(to_hash)
end