Class: Io::Flow::V0::Models::OriginalPrices
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::OriginalPrices
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Model representing original and max values and currencies.
Instance Attribute Summary collapse
-
#max ⇒ Object
readonly
Returns the value of attribute max.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ OriginalPrices
constructor
A new instance of OriginalPrices.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ OriginalPrices
Returns a new instance of OriginalPrices.
25710 25711 25712 25713 25714 25715 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25710 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:value, :max], 'OriginalPrices') @value = (x = opts.delete(:value); x.is_a?(::Io::Flow::V0::Models::Price) ? x : ::Io::Flow::V0::Models::Price.new(x)) @max = (x = opts.delete(:max); x.is_a?(::Io::Flow::V0::Models::Price) ? x : ::Io::Flow::V0::Models::Price.new(x)) end |
Instance Attribute Details
#max ⇒ Object (readonly)
Returns the value of attribute max.
25708 25709 25710 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25708 def max @max end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
25708 25709 25710 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25708 def value @value end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
25721 25722 25723 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25721 def copy(incoming={}) OriginalPrices.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
25725 25726 25727 25728 25729 25730 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25725 def to_hash { :value => value.to_hash, :max => max.to_hash } end |
#to_json ⇒ Object
25717 25718 25719 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25717 def to_json JSON.dump(to_hash) end |