Class: Io::Flow::Reference::V0::Models::LocalizedTranslation

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_reference_v0_client.rb

Overview

Localized translation of a given province/region/country

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ LocalizedTranslation

Returns a new instance of LocalizedTranslation.



679
680
681
682
683
684
# File 'lib/flow_reference_v0_client.rb', line 679

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

Instance Attribute Details

#localeObject (readonly)

Returns the value of attribute locale.



677
678
679
# File 'lib/flow_reference_v0_client.rb', line 677

def locale
  @locale
end

#nameObject (readonly)

Returns the value of attribute name.



677
678
679
# File 'lib/flow_reference_v0_client.rb', line 677

def name
  @name
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



690
691
692
# File 'lib/flow_reference_v0_client.rb', line 690

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

#to_hashObject



694
695
696
697
698
699
# File 'lib/flow_reference_v0_client.rb', line 694

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

#to_jsonObject



686
687
688
# File 'lib/flow_reference_v0_client.rb', line 686

def to_json
  JSON.dump(to_hash)
end