Class: Io::Flow::V0::Models::ExperienceGeo
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ExperienceGeo
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Experience Geo summarizes an experience along with geographic info
Instance Attribute Summary collapse
-
#country ⇒ Object
readonly
Returns the value of attribute country.
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#language ⇒ Object
readonly
Returns the value of attribute language.
-
#measurement_system ⇒ Object
readonly
Returns the value of attribute measurement_system.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#region ⇒ Object
readonly
Returns the value of attribute region.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ ExperienceGeo
constructor
A new instance of ExperienceGeo.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ ExperienceGeo
Returns a new instance of ExperienceGeo.
18389 18390 18391 18392 18393 18394 18395 18396 18397 18398 18399 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18389 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:key, :name, :region, :country, :currency, :language, :measurement_system], 'ExperienceGeo') @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String) @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String) @region = (x = opts.delete(:region); x.is_a?(::Io::Flow::V0::Models::RegionReference) ? x : ::Io::Flow::V0::Models::RegionReference.new(x)) @country = HttpClient::Preconditions.assert_class('country', opts.delete(:country), String) @currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String) @language = HttpClient::Preconditions.assert_class('language', opts.delete(:language), String) @measurement_system = (x = opts.delete(:measurement_system); x.is_a?(::Io::Flow::V0::Models::MeasurementSystem) ? x : ::Io::Flow::V0::Models::MeasurementSystem.apply(x)) end |
Instance Attribute Details
#country ⇒ Object (readonly)
Returns the value of attribute country.
18387 18388 18389 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18387 def country @country end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
18387 18388 18389 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18387 def currency @currency end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
18387 18388 18389 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18387 def key @key end |
#language ⇒ Object (readonly)
Returns the value of attribute language.
18387 18388 18389 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18387 def language @language end |
#measurement_system ⇒ Object (readonly)
Returns the value of attribute measurement_system.
18387 18388 18389 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18387 def measurement_system @measurement_system end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
18387 18388 18389 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18387 def name @name end |
#region ⇒ Object (readonly)
Returns the value of attribute region.
18387 18388 18389 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18387 def region @region end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
18405 18406 18407 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18405 def copy(incoming={}) ExperienceGeo.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
18409 18410 18411 18412 18413 18414 18415 18416 18417 18418 18419 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18409 def to_hash { :key => key, :name => name, :region => region.to_hash, :country => country, :currency => currency, :language => language, :measurement_system => measurement_system.value } end |
#to_json ⇒ Object
18401 18402 18403 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18401 def to_json JSON.dump(to_hash) end |