Class: Io::Flow::V0::Models::InventoryRequestItem
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::InventoryRequestItem
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#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 = {}) ⇒ InventoryRequestItem
constructor
A new instance of InventoryRequestItem.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ InventoryRequestItem
36101 36102 36103 36104 36105 36106 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36101 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:number, :quantity], 'InventoryRequestItem') @number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String) @quantity = HttpClient::Preconditions.assert_class('quantity', opts.delete(:quantity), Integer) end |
Instance Attribute Details
#number ⇒ Object (readonly)
Returns the value of attribute number.
36099 36100 36101 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36099 def number @number end |
#quantity ⇒ Object (readonly)
Returns the value of attribute quantity.
36099 36100 36101 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36099 def quantity @quantity end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
36112 36113 36114 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36112 def copy(incoming={}) InventoryRequestItem.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
36116 36117 36118 36119 36120 36121 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36116 def to_hash { :number => number, :quantity => quantity } end |
#to_json ⇒ Object
36108 36109 36110 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36108 def to_json JSON.dump(to_hash) end |