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.
31436 31437 31438 31439 31440 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31436 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.
31434 31435 31436 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31434 def items @items end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
31446 31447 31448 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31446 def copy(incoming={}) InventoryRequest.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
31450 31451 31452 31453 31454 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31450 def to_hash { :items => items.map { |o| o.to_hash } } end |
#to_json ⇒ Object
31442 31443 31444 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31442 def to_json JSON.dump(to_hash) end |