Class: Io::Flow::V0::Models::Experience
- Inherits:
-
ExpandableExperience
- Object
- ExpandableExperience
- 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.
-
#settings ⇒ Object
readonly
Returns the value of attribute settings.
-
#subcatalog ⇒ Object
readonly
Returns the value of attribute subcatalog.
Attributes inherited from ExpandableExperience
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ Experience
constructor
A new instance of Experience.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from ExpandableExperience
Constructor Details
#initialize(incoming = {}) ⇒ Experience
Returns a new instance of Experience.
13012 13013 13014 13015 13016 13017 13018 13019 13020 13021 13022 13023 13024 13025 13026 13027 13028 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13012 def initialize(incoming={}) super(:discriminator => ExpandableExperience::Types::EXPERIENCE) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:id, :key, :name, :delivered_duty, :region, :country, :currency, :language, :measurement_system, :subcatalog, :position, :settings], '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) @settings = (x = opts.delete(:settings); x.is_a?(::Io::Flow::V0::Models::ExperienceSettings) ? x : ::Io::Flow::V0::Models::ExperienceSettings.new(x)) end |
Instance Attribute Details
#country ⇒ Object (readonly)
Returns the value of attribute country.
13010 13011 13012 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13010 def country @country end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
13010 13011 13012 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13010 def currency @currency end |
#delivered_duty ⇒ Object (readonly)
Returns the value of attribute delivered_duty.
13010 13011 13012 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13010 def delivered_duty @delivered_duty end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
13010 13011 13012 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13010 def id @id end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
13010 13011 13012 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13010 def key @key end |
#language ⇒ Object (readonly)
Returns the value of attribute language.
13010 13011 13012 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13010 def language @language end |
#measurement_system ⇒ Object (readonly)
Returns the value of attribute measurement_system.
13010 13011 13012 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13010 def measurement_system @measurement_system end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
13010 13011 13012 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13010 def name @name end |
#position ⇒ Object (readonly)
Returns the value of attribute position.
13010 13011 13012 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13010 def position @position end |
#region ⇒ Object (readonly)
Returns the value of attribute region.
13010 13011 13012 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13010 def region @region end |
#settings ⇒ Object (readonly)
Returns the value of attribute settings.
13010 13011 13012 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13010 def settings @settings end |
#subcatalog ⇒ Object (readonly)
Returns the value of attribute subcatalog.
13010 13011 13012 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13010 def subcatalog @subcatalog end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
13034 13035 13036 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13034 def copy(incoming={}) Experience.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
13038 13039 13040 13041 13042 13043 13044 13045 13046 13047 13048 13049 13050 13051 13052 13053 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13038 def subtype_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, :settings => settings.to_hash } end |
#to_json ⇒ Object
13030 13031 13032 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13030 def to_json JSON.dump(to_hash) end |