Class: Io::Flow::V0::Models::Locale
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::Locale
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Locales defines standard conventions for presentation of content. See api.flow.io/reference/locales
Instance Attribute Summary collapse
-
#country ⇒ Object
readonly
Returns the value of attribute country.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#language ⇒ Object
readonly
Returns the value of attribute language.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#numbers ⇒ Object
readonly
Returns the value of attribute numbers.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ Locale
constructor
A new instance of Locale.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ Locale
Returns a new instance of Locale.
15711 15712 15713 15714 15715 15716 15717 15718 15719 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15711 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:id, :name, :country, :language, :numbers], 'Locale') @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String) @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String) @country = HttpClient::Preconditions.assert_class('country', opts.delete(:country), String) @language = HttpClient::Preconditions.assert_class('language', opts.delete(:language), String) @numbers = (x = opts.delete(:numbers); x.is_a?(::Io::Flow::V0::Models::LocaleNumbers) ? x : ::Io::Flow::V0::Models::LocaleNumbers.new(x)) end |
Instance Attribute Details
#country ⇒ Object (readonly)
Returns the value of attribute country.
15709 15710 15711 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15709 def country @country end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
15709 15710 15711 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15709 def id @id end |
#language ⇒ Object (readonly)
Returns the value of attribute language.
15709 15710 15711 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15709 def language @language end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
15709 15710 15711 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15709 def name @name end |
#numbers ⇒ Object (readonly)
Returns the value of attribute numbers.
15709 15710 15711 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15709 def numbers @numbers end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
15725 15726 15727 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15725 def copy(incoming={}) Locale.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
15729 15730 15731 15732 15733 15734 15735 15736 15737 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15729 def to_hash { :id => id, :name => name, :country => country, :language => language, :numbers => numbers.to_hash } end |
#to_json ⇒ Object
15721 15722 15723 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15721 def to_json JSON.dump(to_hash) end |