Class: Io::Flow::V0::Models::InventoryCheckResponse
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::InventoryCheckResponse
- 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 = {}) ⇒ InventoryCheckResponse
constructor
A new instance of InventoryCheckResponse.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ InventoryCheckResponse
Returns a new instance of InventoryCheckResponse.
31328 31329 31330 31331 31332 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31328 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:items], 'InventoryCheckResponse') @items = HttpClient::Preconditions.assert_class('items', opts.delete(:items), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::InventoryCheckResponseItem) ? x : ::Io::Flow::V0::Models::InventoryCheckResponseItem.new(x)) } end |
Instance Attribute Details
#items ⇒ Object (readonly)
Returns the value of attribute items.
31326 31327 31328 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31326 def items @items end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
31338 31339 31340 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31338 def copy(incoming={}) InventoryCheckResponse.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
31342 31343 31344 31345 31346 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31342 def to_hash { :items => items.map { |o| o.to_hash } } end |
#to_json ⇒ Object
31334 31335 31336 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31334 def to_json JSON.dump(to_hash) end |