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.



26618
26619
26620
26621
26622
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26618

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.



26616
26617
26618
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26616

def key
  @key
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



26628
26629
26630
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26628

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

#to_hashObject



26632
26633
26634
26635
26636
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26632

def to_hash
  {
    :key => key
  }
end

#to_jsonObject



26624
26625
26626
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26624

def to_json
  JSON.dump(to_hash)
end