Class: Io::Flow::V0::Models::LocalPriceDetails
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::LocalPriceDetails
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#base ⇒ Object
readonly
Returns the value of attribute base.
-
#discount ⇒ Object
readonly
Returns the value of attribute discount.
-
#local ⇒ Object
readonly
Returns the value of attribute local.
-
#local_before_discount ⇒ Object
readonly
Returns the value of attribute local_before_discount.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ LocalPriceDetails
constructor
A new instance of LocalPriceDetails.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ LocalPriceDetails
Returns a new instance of LocalPriceDetails.
18806 18807 18808 18809 18810 18811 18812 18813 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18806 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:base, :local], 'LocalPriceDetails') @base = (x = opts.delete(:base); x.is_a?(::Io::Flow::V0::Models::PriceDetails) ? x : ::Io::Flow::V0::Models::PriceDetails.new(x)) @local = (x = opts.delete(:local); x.is_a?(::Io::Flow::V0::Models::PriceDetails) ? x : ::Io::Flow::V0::Models::PriceDetails.new(x)) @discount = (x = opts.delete(:discount); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::PriceDetail) ? x : ::Io::Flow::V0::Models::PriceDetail.new(x))) @local_before_discount = (x = opts.delete(:local_before_discount); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::PriceDetail) ? x : ::Io::Flow::V0::Models::PriceDetail.new(x))) end |
Instance Attribute Details
#base ⇒ Object (readonly)
Returns the value of attribute base.
18804 18805 18806 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18804 def base @base end |
#discount ⇒ Object (readonly)
Returns the value of attribute discount.
18804 18805 18806 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18804 def discount @discount end |
#local ⇒ Object (readonly)
Returns the value of attribute local.
18804 18805 18806 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18804 def local @local end |
#local_before_discount ⇒ Object (readonly)
Returns the value of attribute local_before_discount.
18804 18805 18806 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18804 def local_before_discount @local_before_discount end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
18819 18820 18821 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18819 def copy(incoming={}) LocalPriceDetails.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
18823 18824 18825 18826 18827 18828 18829 18830 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18823 def to_hash { :base => base.to_hash, :local => local.to_hash, :discount => discount.nil? ? nil : discount.to_hash, :local_before_discount => local_before_discount.nil? ? nil : local_before_discount.to_hash } end |
#to_json ⇒ Object
18815 18816 18817 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18815 def to_json JSON.dump(to_hash) end |