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.
22630 22631 22632 22633 22634 22635 22636 22637 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22630 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.
22628 22629 22630 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22628 def base @base end |
#discount ⇒ Object (readonly)
Returns the value of attribute discount.
22628 22629 22630 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22628 def discount @discount end |
#local ⇒ Object (readonly)
Returns the value of attribute local.
22628 22629 22630 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22628 def local @local end |
#local_before_discount ⇒ Object (readonly)
Returns the value of attribute local_before_discount.
22628 22629 22630 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22628 def local_before_discount @local_before_discount end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
22643 22644 22645 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22643 def copy(incoming={}) LocalPriceDetails.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
22647 22648 22649 22650 22651 22652 22653 22654 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22647 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
22639 22640 22641 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22639 def to_json JSON.dump(to_hash) end |