Class: Io::Flow::V0::Models::PriceDetails
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::PriceDetails
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Detailed information for the pricing of a given item within an experience
Instance Attribute Summary collapse
-
#base ⇒ Object
readonly
Returns the value of attribute base.
-
#currency_margin ⇒ Object
readonly
Returns the value of attribute currency_margin.
-
#duty ⇒ Object
readonly
Returns the value of attribute duty.
-
#local ⇒ Object
readonly
Returns the value of attribute local.
-
#margin ⇒ Object
readonly
Returns the value of attribute margin.
-
#rounding ⇒ Object
readonly
Returns the value of attribute rounding.
-
#total ⇒ Object
readonly
Returns the value of attribute total.
-
#vat ⇒ Object
readonly
Returns the value of attribute vat.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ PriceDetails
constructor
A new instance of PriceDetails.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ PriceDetails
Returns a new instance of PriceDetails.
13912 13913 13914 13915 13916 13917 13918 13919 13920 13921 13922 13923 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13912 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:base, :local, :currency_margin, :margin, :vat, :duty, :rounding, :total], 'PriceDetails') @base = (x = opts.delete(:base); x.is_a?(::Io::Flow::V0::Models::Price) ? x : ::Io::Flow::V0::Models::Price.new(x)) @local = (x = opts.delete(:local); x.is_a?(::Io::Flow::V0::Models::Price) ? x : ::Io::Flow::V0::Models::Price.new(x)) @currency_margin = (x = opts.delete(:currency_margin); x.is_a?(::Io::Flow::V0::Models::Price) ? x : ::Io::Flow::V0::Models::Price.new(x)) @margin = (x = opts.delete(:margin); x.is_a?(::Io::Flow::V0::Models::Price) ? x : ::Io::Flow::V0::Models::Price.new(x)) @vat = (x = opts.delete(:vat); x.is_a?(::Io::Flow::V0::Models::Price) ? x : ::Io::Flow::V0::Models::Price.new(x)) @duty = (x = opts.delete(:duty); x.is_a?(::Io::Flow::V0::Models::Price) ? x : ::Io::Flow::V0::Models::Price.new(x)) @rounding = (x = opts.delete(:rounding); x.is_a?(::Io::Flow::V0::Models::Price) ? x : ::Io::Flow::V0::Models::Price.new(x)) @total = (x = opts.delete(:total); x.is_a?(::Io::Flow::V0::Models::Price) ? x : ::Io::Flow::V0::Models::Price.new(x)) end |
Instance Attribute Details
#base ⇒ Object (readonly)
Returns the value of attribute base.
13910 13911 13912 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13910 def base @base end |
#currency_margin ⇒ Object (readonly)
Returns the value of attribute currency_margin.
13910 13911 13912 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13910 def currency_margin @currency_margin end |
#duty ⇒ Object (readonly)
Returns the value of attribute duty.
13910 13911 13912 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13910 def duty @duty end |
#local ⇒ Object (readonly)
Returns the value of attribute local.
13910 13911 13912 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13910 def local @local end |
#margin ⇒ Object (readonly)
Returns the value of attribute margin.
13910 13911 13912 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13910 def margin @margin end |
#rounding ⇒ Object (readonly)
Returns the value of attribute rounding.
13910 13911 13912 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13910 def rounding @rounding end |
#total ⇒ Object (readonly)
Returns the value of attribute total.
13910 13911 13912 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13910 def total @total end |
#vat ⇒ Object (readonly)
Returns the value of attribute vat.
13910 13911 13912 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13910 def vat @vat end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
13929 13930 13931 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13929 def copy(incoming={}) PriceDetails.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
13933 13934 13935 13936 13937 13938 13939 13940 13941 13942 13943 13944 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13933 def to_hash { :base => base.to_hash, :local => local.to_hash, :currency_margin => currency_margin.to_hash, :margin => margin.to_hash, :vat => vat.to_hash, :duty => duty.to_hash, :rounding => rounding.to_hash, :total => total.to_hash } end |
#to_json ⇒ Object
13925 13926 13927 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13925 def to_json JSON.dump(to_hash) end |