Class: Io::Flow::V0::Models::InventoryCenterReference

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 = {}) ⇒ InventoryCenterReference

Returns a new instance of InventoryCenterReference.



16122
16123
16124
16125
16126
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16122

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:key], 'InventoryCenterReference')
  @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String)
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



16120
16121
16122
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16120

def key
  @key
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



16132
16133
16134
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16132

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

#to_hashObject



16136
16137
16138
16139
16140
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16136

def to_hash
  {
    :key => key
  }
end

#to_jsonObject



16128
16129
16130
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16128

def to_json
  JSON.dump(to_hash)
end