Class: Io::Flow::V0::Models::ShippingConfigurationReference

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

Returns a new instance of ShippingConfigurationReference.



36346
36347
36348
36349
36350
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36346

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

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



36344
36345
36346
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36344

def key
  @key
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



36356
36357
36358
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36356

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

#to_hashObject



36360
36361
36362
36363
36364
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36360

def to_hash
  {
    :key => key
  }
end

#to_jsonObject



36352
36353
36354
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36352

def to_json
  JSON.dump(to_hash)
end