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.



20812
20813
20814
20815
20816
20817
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20812

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.



20810
20811
20812
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20810

def locale
  @locale
end

#nameObject (readonly)

Returns the value of attribute name.



20810
20811
20812
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20810

def name
  @name
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



20823
20824
20825
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20823

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

#to_hashObject



20827
20828
20829
20830
20831
20832
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20827

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

#to_jsonObject



20819
20820
20821
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20819

def to_json
  JSON.dump(to_hash)
end