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
Returns a new instance of InventoryRequestItem.
33234 33235 33236 33237 33238 33239 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33234 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.
33232 33233 33234 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33232 def number @number end |
#quantity ⇒ Object (readonly)
Returns the value of attribute quantity.
33232 33233 33234 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33232 def quantity @quantity end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
33245 33246 33247 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33245 def copy(incoming={}) InventoryRequestItem.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
33249 33250 33251 33252 33253 33254 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33249 def to_hash { :number => number, :quantity => quantity } end |
#to_json ⇒ Object
33241 33242 33243 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33241 def to_json JSON.dump(to_hash) end |