Class: Io::Flow::V0::Models::InventoryRequest
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::InventoryRequest
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#items ⇒ Object
readonly
Returns the value of attribute items.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ InventoryRequest
constructor
A new instance of InventoryRequest.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ InventoryRequest
Returns a new instance of InventoryRequest.
24379 24380 24381 24382 24383 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24379 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:items], 'InventoryRequest') @items = HttpClient::Preconditions.assert_class('items', opts.delete(:items), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::InventoryRequestItem) ? x : ::Io::Flow::V0::Models::InventoryRequestItem.new(x)) } end |
Instance Attribute Details
#items ⇒ Object (readonly)
Returns the value of attribute items.
24377 24378 24379 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24377 def items @items end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
24389 24390 24391 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24389 def copy(incoming={}) InventoryRequest.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
24393 24394 24395 24396 24397 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24393 def to_hash { :items => items.map { |o| o.to_hash } } end |
#to_json ⇒ Object
24385 24386 24387 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24385 def to_json JSON.dump(to_hash) end |