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.
28810 28811 28812 28813 28814 28815 28816 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28810 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.
28808 28809 28810 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28808 def inventory_status @inventory_status end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
28808 28809 28810 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28808 def number @number end |
#quantity ⇒ Object (readonly)
Returns the value of attribute quantity.
28808 28809 28810 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28808 def quantity @quantity end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
28822 28823 28824 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28822 def copy(incoming={}) InventoryCheckResponseItem.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
28826 28827 28828 28829 28830 28831 28832 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28826 def to_hash { :number => number, :quantity => quantity, :inventory_status => inventory_status.value } end |
#to_json ⇒ Object
28818 28819 28820 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28818 def to_json JSON.dump(to_hash) end |