Class: Io::Flow::V0::Models::InventoryCheckResponseItem
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::InventoryCheckResponseItem
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#inventory_status ⇒ Object
readonly
Returns the value of attribute inventory_status.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
-
#quantity ⇒ Object
readonly
Returns the value of attribute quantity.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ InventoryCheckResponseItem
constructor
A new instance of InventoryCheckResponseItem.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ InventoryCheckResponseItem
Returns a new instance of InventoryCheckResponseItem.
24323 24324 24325 24326 24327 24328 24329 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24323 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:number, :quantity, :inventory_status], 'InventoryCheckResponseItem') @number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String) @quantity = HttpClient::Preconditions.assert_class('quantity', opts.delete(:quantity), Integer) @inventory_status = (x = opts.delete(:inventory_status); x.is_a?(::Io::Flow::V0::Models::InventoryStatus) ? x : ::Io::Flow::V0::Models::InventoryStatus.apply(x)) end |
Instance Attribute Details
#inventory_status ⇒ Object (readonly)
Returns the value of attribute inventory_status.
24321 24322 24323 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24321 def inventory_status @inventory_status end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
24321 24322 24323 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24321 def number @number end |
#quantity ⇒ Object (readonly)
Returns the value of attribute quantity.
24321 24322 24323 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24321 def quantity @quantity end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
24335 24336 24337 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24335 def copy(incoming={}) InventoryCheckResponseItem.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
24339 24340 24341 24342 24343 24344 24345 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24339 def to_hash { :number => number, :quantity => quantity, :inventory_status => inventory_status.value } end |
#to_json ⇒ Object
24331 24332 24333 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24331 def to_json JSON.dump(to_hash) end |