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.
23206 23207 23208 23209 23210 23211 23212 23213 23214 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23206 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.
23204 23205 23206 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23204 def country @country end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
23204 23205 23206 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23204 def id @id end |
#language ⇒ Object (readonly)
Returns the value of attribute language.
23204 23205 23206 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23204 def language @language end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
23204 23205 23206 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23204 def name @name end |
#numbers ⇒ Object (readonly)
Returns the value of attribute numbers.
23204 23205 23206 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23204 def numbers @numbers end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
23220 23221 23222 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23220 def copy(incoming={}) Locale.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
23224 23225 23226 23227 23228 23229 23230 23231 23232 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23224 def to_hash { :id => id, :name => name, :country => country, :language => language, :numbers => numbers.to_hash } end |
#to_json ⇒ Object
23216 23217 23218 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23216 def to_json JSON.dump(to_hash) end |