Class: Io::Flow::V0::Models::ExperienceDefaults
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ExperienceDefaults
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Defines a set of defaults for a given organization and 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.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ ExperienceDefaults
constructor
A new instance of ExperienceDefaults.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ ExperienceDefaults
Returns a new instance of ExperienceDefaults.
31882 31883 31884 31885 31886 31887 31888 31889 31890 31891 31892 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31882 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:key, :name, :delivered_duty, :country, :currency, :language, :measurement_system], 'ExperienceDefaults') @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)) @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.
31880 31881 31882 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31880 def country @country end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
31880 31881 31882 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31880 def currency @currency end |
#delivered_duty ⇒ Object (readonly)
Returns the value of attribute delivered_duty.
31880 31881 31882 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31880 def delivered_duty @delivered_duty end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
31880 31881 31882 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31880 def key @key end |
#language ⇒ Object (readonly)
Returns the value of attribute language.
31880 31881 31882 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31880 def language @language end |
#measurement_system ⇒ Object (readonly)
Returns the value of attribute measurement_system.
31880 31881 31882 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31880 def measurement_system @measurement_system end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
31880 31881 31882 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31880 def name @name end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
31898 31899 31900 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31898 def copy(incoming={}) ExperienceDefaults.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
31902 31903 31904 31905 31906 31907 31908 31909 31910 31911 31912 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31902 def to_hash { :key => key, :name => name, :delivered_duty => delivered_duty.value, :country => country, :currency => currency, :language => language, :measurement_system => measurement_system.value } end |
#to_json ⇒ Object
31894 31895 31896 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31894 def to_json JSON.dump(to_hash) end |