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.
34220 34221 34222 34223 34224 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34220 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.
34218 34219 34220 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34218 def items @items end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
34230 34231 34232 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34230 def copy(incoming={}) InventoryRequest.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
34234 34235 34236 34237 34238 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34234 def to_hash { :items => items.map { |o| o.to_hash } } end |
#to_json ⇒ Object
34226 34227 34228 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34226 def to_json JSON.dump(to_hash) end |