Class: Io::Flow::V0::Models::AddressConfigurationProvinceTranslation

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

Returns a new instance of AddressConfigurationProvinceTranslation.



22309
22310
22311
22312
22313
22314
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22309

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:locale, :name], 'AddressConfigurationProvinceTranslation')
  @locale = (x = opts.delete(:locale); x.is_a?(::Io::Flow::V0::Models::AddressConfigurationProvinceTranslationLocale) ? x : ::Io::Flow::V0::Models::AddressConfigurationProvinceTranslationLocale.new(x))
  @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
end

Instance Attribute Details

#localeObject (readonly)

Returns the value of attribute locale.



22307
22308
22309
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22307

def locale
  @locale
end

#nameObject (readonly)

Returns the value of attribute name.



22307
22308
22309
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22307

def name
  @name
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



22320
22321
22322
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22320

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

#to_hashObject



22324
22325
22326
22327
22328
22329
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22324

def to_hash
  {
    :locale => locale.to_hash,
    :name => name
  }
end

#to_jsonObject



22316
22317
22318
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22316

def to_json
  JSON.dump(to_hash)
end