Class: Io::Flow::V0::Models::TierDefault
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::TierDefault
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Grouping of shipping tiers by experience to provide logical default functionality.
Instance Attribute Summary collapse
-
#default_tier ⇒ Object
readonly
Returns the value of attribute default_tier.
-
#experience ⇒ Object
readonly
Returns the value of attribute experience.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ TierDefault
constructor
A new instance of TierDefault.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ TierDefault
Returns a new instance of TierDefault.
23000 23001 23002 23003 23004 23005 23006 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23000 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:id, :default_tier, :experience], 'TierDefault') @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String) @default_tier = (x = opts.delete(:default_tier); x.is_a?(::Io::Flow::V0::Models::TierReference) ? x : ::Io::Flow::V0::Models::TierReference.new(x)) @experience = (x = opts.delete(:experience); x.is_a?(::Io::Flow::V0::Models::FulfillmentExperienceReference) ? x : ::Io::Flow::V0::Models::FulfillmentExperienceReference.new(x)) end |
Instance Attribute Details
#default_tier ⇒ Object (readonly)
Returns the value of attribute default_tier.
22998 22999 23000 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22998 def default_tier @default_tier end |
#experience ⇒ Object (readonly)
Returns the value of attribute experience.
22998 22999 23000 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22998 def experience @experience end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
22998 22999 23000 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22998 def id @id end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
23012 23013 23014 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23012 def copy(incoming={}) TierDefault.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
23016 23017 23018 23019 23020 23021 23022 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23016 def to_hash { :id => id, :default_tier => default_tier.to_hash, :experience => experience.to_hash } end |
#to_json ⇒ Object
23008 23009 23010 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23008 def to_json JSON.dump(to_hash) end |