Class: Io::Flow::V0::Models::PfsInventoryCheckResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ PfsInventoryCheckResponse

Returns a new instance of PfsInventoryCheckResponse.



43129
43130
43131
43132
43133
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43129

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:items], 'PfsInventoryCheckResponse')
  @items = HttpClient::Preconditions.assert_class('items', opts.delete(:items), Hash).inject({}) { |h, d| h[d[0]] = (x = d[1]; x.is_a?(::Io::Flow::V0::Models::PfsInventoryCheckResponseItem) ? x : ::Io::Flow::V0::Models::PfsInventoryCheckResponseItem.new(x)); h }
end

Instance Attribute Details

#itemsObject (readonly)

Returns the value of attribute items.



43127
43128
43129
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43127

def items
  @items
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



43139
43140
43141
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43139

def copy(incoming={})
  PfsInventoryCheckResponse.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#to_hashObject



43143
43144
43145
43146
43147
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43143

def to_hash
  {
    :items => items.inject({}) { |hash, o| hash[o[0]] = o[1].nil? ? nil : o[1].to_hash; hash }
  }
end

#to_jsonObject



43135
43136
43137
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43135

def to_json
  JSON.dump(to_hash)
end