Class: Io::Flow::V0::Models::InventoryItemReference

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

Returns a new instance of InventoryItemReference.



12316
12317
12318
12319
12320
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12316

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

Instance Attribute Details

#numberObject (readonly)

Returns the value of attribute number.



12314
12315
12316
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12314

def number
  @number
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



12326
12327
12328
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12326

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

#to_hashObject



12330
12331
12332
12333
12334
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12330

def to_hash
  {
    :number => number
  }
end

#to_jsonObject



12322
12323
12324
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12322

def to_json
  JSON.dump(to_hash)
end