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.
25588 25589 25590 25591 25592 25593 25594 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25588 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.
25586 25587 25588 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25586 def inventory_status @inventory_status end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
25586 25587 25588 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25586 def number @number end |
#quantity ⇒ Object (readonly)
Returns the value of attribute quantity.
25586 25587 25588 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25586 def quantity @quantity end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
25600 25601 25602 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25600 def copy(incoming={}) InventoryCheckResponseItem.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
25604 25605 25606 25607 25608 25609 25610 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25604 def to_hash { :number => number, :quantity => quantity, :inventory_status => inventory_status.value } end |
#to_json ⇒ Object
25596 25597 25598 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25596 def to_json JSON.dump(to_hash) end |