Class: Io::Flow::V0::Models::InventoryExperienceReference

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 = {}) ⇒ InventoryExperienceReference

Returns a new instance of InventoryExperienceReference.



35472
35473
35474
35475
35476
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35472

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

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



35470
35471
35472
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35470

def key
  @key
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



35482
35483
35484
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35482

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

#to_hashObject



35486
35487
35488
35489
35490
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35486

def to_hash
  {
    :key => key
  }
end

#to_jsonObject



35478
35479
35480
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35478

def to_json
  JSON.dump(to_hash)
end