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.
42863 42864 42865 42866 42867 42868 42869 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42863 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.
42861 42862 42863 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42861 def inventory_status @inventory_status end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
42861 42862 42863 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42861 def number @number end |
#quantity ⇒ Object (readonly)
Returns the value of attribute quantity.
42861 42862 42863 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42861 def quantity @quantity end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
42875 42876 42877 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42875 def copy(incoming={}) InventoryCheckResponseItem.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
42879 42880 42881 42882 42883 42884 42885 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42879 def to_hash { :number => number, :quantity => quantity, :inventory_status => inventory_status.value } end |
#to_json ⇒ Object
42871 42872 42873 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42871 def to_json JSON.dump(to_hash) end |