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.



12290
12291
12292
12293
12294
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12290

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.



12288
12289
12290
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12288

def key
  @key
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



12300
12301
12302
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12300

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

#to_hashObject



12304
12305
12306
12307
12308
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12304

def to_hash
  {
    :key => key
  }
end

#to_jsonObject



12296
12297
12298
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12296

def to_json
  JSON.dump(to_hash)
end