Class: Io::Flow::V0::Models::LocalizedTranslation
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::LocalizedTranslation
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Localized translation of a given province/region/country
Instance Attribute Summary collapse
-
#locale ⇒ Object
readonly
Returns the value of attribute locale.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ LocalizedTranslation
constructor
A new instance of LocalizedTranslation.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ LocalizedTranslation
Returns a new instance of LocalizedTranslation.
38095 38096 38097 38098 38099 38100 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38095 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::V0::Models::Locale) ? x : ::Io::Flow::V0::Models::Locale.new(x)) @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String) end |
Instance Attribute Details
#locale ⇒ Object (readonly)
Returns the value of attribute locale.
38093 38094 38095 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38093 def locale @locale end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
38093 38094 38095 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38093 def name @name end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
38106 38107 38108 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38106 def copy(incoming={}) LocalizedTranslation.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
38110 38111 38112 38113 38114 38115 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38110 def to_hash { :locale => locale.to_hash, :name => name } end |
#to_json ⇒ Object
38102 38103 38104 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38102 def to_json JSON.dump(to_hash) end |