Class: Io::Flow::V0::Models::Experience
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::Experience
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Experiences define a local experience for a given geographic region
Instance Attribute Summary collapse
-
#country ⇒ Object
readonly
Returns the value of attribute country.
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
-
#delivered_duty ⇒ Object
readonly
Returns the value of attribute delivered_duty.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#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.
-
#position ⇒ Object
readonly
Returns the value of attribute position.
-
#region ⇒ Object
readonly
Returns the value of attribute region.
-
#subcatalog ⇒ Object
readonly
Returns the value of attribute subcatalog.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ Experience
constructor
A new instance of Experience.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ Experience
Returns a new instance of Experience.
10545 10546 10547 10548 10549 10550 10551 10552 10553 10554 10555 10556 10557 10558 10559 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10545 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:id, :key, :name, :delivered_duty, :region, :country, :currency, :language, :measurement_system, :subcatalog, :position], 'Experience') @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String) @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String) @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String) @delivered_duty = (x = opts.delete(:delivered_duty); x.is_a?(::Io::Flow::V0::Models::DeliveredDuty) ? x : ::Io::Flow::V0::Models::DeliveredDuty.apply(x)) @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)) @subcatalog = (x = opts.delete(:subcatalog); x.is_a?(::Io::Flow::V0::Models::SubcatalogReference) ? x : ::Io::Flow::V0::Models::SubcatalogReference.new(x)) @position = HttpClient::Preconditions.assert_class('position', opts.delete(:position), Integer) end |
Instance Attribute Details
#country ⇒ Object (readonly)
Returns the value of attribute country.
10543 10544 10545 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10543 def country @country end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
10543 10544 10545 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10543 def currency @currency end |
#delivered_duty ⇒ Object (readonly)
Returns the value of attribute delivered_duty.
10543 10544 10545 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10543 def delivered_duty @delivered_duty end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
10543 10544 10545 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10543 def id @id end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
10543 10544 10545 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10543 def key @key end |
#language ⇒ Object (readonly)
Returns the value of attribute language.
10543 10544 10545 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10543 def language @language end |
#measurement_system ⇒ Object (readonly)
Returns the value of attribute measurement_system.
10543 10544 10545 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10543 def measurement_system @measurement_system end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
10543 10544 10545 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10543 def name @name end |
#position ⇒ Object (readonly)
Returns the value of attribute position.
10543 10544 10545 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10543 def position @position end |
#region ⇒ Object (readonly)
Returns the value of attribute region.
10543 10544 10545 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10543 def region @region end |
#subcatalog ⇒ Object (readonly)
Returns the value of attribute subcatalog.
10543 10544 10545 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10543 def subcatalog @subcatalog end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
10565 10566 10567 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10565 def copy(incoming={}) Experience.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
10569 10570 10571 10572 10573 10574 10575 10576 10577 10578 10579 10580 10581 10582 10583 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10569 def to_hash { :id => id, :key => key, :name => name, :delivered_duty => delivered_duty.value, :region => region.to_hash, :country => country, :currency => currency, :language => language, :measurement_system => measurement_system.value, :subcatalog => subcatalog.to_hash, :position => position } end |
#to_json ⇒ Object
10561 10562 10563 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10561 def to_json JSON.dump(to_hash) end |