Class: Io::Flow::V0::Models::TierSettings
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::TierSettings
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#availability ⇒ Object
readonly
Returns the value of attribute availability.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ TierSettings
constructor
A new instance of TierSettings.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ TierSettings
Returns a new instance of TierSettings.
54160 54161 54162 54163 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 54160 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) @availability = (x = (x = opts.delete(:availability); x.nil? ? "always" : x); x.is_a?(::Io::Flow::V0::Models::TierAvailability) ? x : ::Io::Flow::V0::Models::TierAvailability.apply(x)) end |
Instance Attribute Details
#availability ⇒ Object (readonly)
Returns the value of attribute availability.
54158 54159 54160 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 54158 def availability @availability end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
54169 54170 54171 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 54169 def copy(incoming={}) TierSettings.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
54173 54174 54175 54176 54177 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 54173 def to_hash { :availability => availability.value } end |
#to_json ⇒ Object
54165 54166 54167 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 54165 def to_json JSON.dump(to_hash) end |