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.
37764 37765 37766 37767 37768 37769 37770 37771 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37764 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.
37762 37763 37764 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37762 def base @base end |
#discount ⇒ Object (readonly)
Returns the value of attribute discount.
37762 37763 37764 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37762 def discount @discount end |
#local ⇒ Object (readonly)
Returns the value of attribute local.
37762 37763 37764 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37762 def local @local end |
#local_before_discount ⇒ Object (readonly)
Returns the value of attribute local_before_discount.
37762 37763 37764 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37762 def local_before_discount @local_before_discount end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
37777 37778 37779 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37777 def copy(incoming={}) LocalPriceDetails.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
37781 37782 37783 37784 37785 37786 37787 37788 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37781 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
37773 37774 37775 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37773 def to_json JSON.dump(to_hash) end |