Class: Io::Flow::V0::Models::ExperienceForm
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ExperienceForm
- 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.
-
#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_id ⇒ Object
readonly
Returns the value of attribute region_id.
-
#subcatalog_id ⇒ Object
readonly
Returns the value of attribute subcatalog_id.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ ExperienceForm
constructor
A new instance of ExperienceForm.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ ExperienceForm
Returns a new instance of ExperienceForm.
41814 41815 41816 41817 41818 41819 41820 41821 41822 41823 41824 41825 41826 41827 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41814 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:region_id, :name], 'ExperienceForm') @region_id = HttpClient::Preconditions.assert_class('region_id', opts.delete(:region_id), String) @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String) @delivered_duty = (x = opts.delete(:delivered_duty); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::DeliveredDuty) ? x : ::Io::Flow::V0::Models::DeliveredDuty.apply(x))) @country = (x = opts.delete(:country); x.nil? ? nil : HttpClient::Preconditions.assert_class('country', x, String)) @currency = (x = opts.delete(:currency); x.nil? ? nil : HttpClient::Preconditions.assert_class('currency', x, String)) @language = (x = opts.delete(:language); x.nil? ? nil : HttpClient::Preconditions.assert_class('language', x, String)) @key = (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, String)) @position = (x = opts.delete(:position); x.nil? ? nil : HttpClient::Preconditions.assert_class('position', x, Integer)) @measurement_system = (x = opts.delete(:measurement_system); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::MeasurementSystem) ? x : ::Io::Flow::V0::Models::MeasurementSystem.apply(x))) @subcatalog_id = (x = opts.delete(:subcatalog_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('subcatalog_id', x, String)) end |
Instance Attribute Details
#country ⇒ Object (readonly)
Returns the value of attribute country.
41812 41813 41814 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41812 def country @country end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
41812 41813 41814 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41812 def currency @currency end |
#delivered_duty ⇒ Object (readonly)
Returns the value of attribute delivered_duty.
41812 41813 41814 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41812 def delivered_duty @delivered_duty end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
41812 41813 41814 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41812 def key @key end |
#language ⇒ Object (readonly)
Returns the value of attribute language.
41812 41813 41814 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41812 def language @language end |
#measurement_system ⇒ Object (readonly)
Returns the value of attribute measurement_system.
41812 41813 41814 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41812 def measurement_system @measurement_system end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
41812 41813 41814 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41812 def name @name end |
#position ⇒ Object (readonly)
Returns the value of attribute position.
41812 41813 41814 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41812 def position @position end |
#region_id ⇒ Object (readonly)
Returns the value of attribute region_id.
41812 41813 41814 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41812 def region_id @region_id end |
#subcatalog_id ⇒ Object (readonly)
Returns the value of attribute subcatalog_id.
41812 41813 41814 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41812 def subcatalog_id @subcatalog_id end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
41833 41834 41835 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41833 def copy(incoming={}) ExperienceForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
41837 41838 41839 41840 41841 41842 41843 41844 41845 41846 41847 41848 41849 41850 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41837 def to_hash { :region_id => region_id, :name => name, :delivered_duty => delivered_duty.nil? ? nil : delivered_duty.value, :country => country, :currency => currency, :language => language, :key => key, :position => position, :measurement_system => measurement_system.nil? ? nil : measurement_system.value, :subcatalog_id => subcatalog_id } end |
#to_json ⇒ Object
41829 41830 41831 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41829 def to_json JSON.dump(to_hash) end |