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.
33593 33594 33595 33596 33597 33598 33599 33600 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33593 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.
33591 33592 33593 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33591 def base @base end |
#discount ⇒ Object (readonly)
Returns the value of attribute discount.
33591 33592 33593 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33591 def discount @discount end |
#local ⇒ Object (readonly)
Returns the value of attribute local.
33591 33592 33593 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33591 def local @local end |
#local_before_discount ⇒ Object (readonly)
Returns the value of attribute local_before_discount.
33591 33592 33593 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33591 def local_before_discount @local_before_discount end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
33606 33607 33608 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33606 def copy(incoming={}) LocalPriceDetails.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
33610 33611 33612 33613 33614 33615 33616 33617 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33610 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
33602 33603 33604 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33602 def to_json JSON.dump(to_hash) end |