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.
34856 34857 34858 34859 34860 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34856 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.
34854 34855 34856 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34854 def items @items end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
34866 34867 34868 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34866 def copy(incoming={}) InventoryRequest.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
34870 34871 34872 34873 34874 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34870 def to_hash { :items => items.map { |o| o.to_hash } } end |
#to_json ⇒ Object
34862 34863 34864 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34862 def to_json JSON.dump(to_hash) end |