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.



29656
29657
29658
29659
29660
29661
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29656

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.



29654
29655
29656
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29654

def locale
  @locale
end

#nameObject (readonly)

Returns the value of attribute name.



29654
29655
29656
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29654

def name
  @name
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



29667
29668
29669
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29667

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

#to_hashObject



29671
29672
29673
29674
29675
29676
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29671

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

#to_jsonObject



29663
29664
29665
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29663

def to_json
  JSON.dump(to_hash)
end