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.
20203 20204 20205 20206 20207 20208 20209 20210 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20203 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.
20201 20202 20203 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20201 def base @base end |
#discount ⇒ Object (readonly)
Returns the value of attribute discount.
20201 20202 20203 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20201 def discount @discount end |
#local ⇒ Object (readonly)
Returns the value of attribute local.
20201 20202 20203 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20201 def local @local end |
#local_before_discount ⇒ Object (readonly)
Returns the value of attribute local_before_discount.
20201 20202 20203 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20201 def local_before_discount @local_before_discount end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
20216 20217 20218 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20216 def copy(incoming={}) LocalPriceDetails.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
20220 20221 20222 20223 20224 20225 20226 20227 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20220 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
20212 20213 20214 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20212 def to_json JSON.dump(to_hash) end |