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.



18384
18385
18386
18387
18388
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18384

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.



18382
18383
18384
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18382

def number
  @number
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



18394
18395
18396
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18394

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

#to_hashObject



18398
18399
18400
18401
18402
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18398

def to_hash
  {
    :number => number
  }
end

#to_jsonObject



18390
18391
18392
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18390

def to_json
  JSON.dump(to_hash)
end