Class: Io::Flow::V0::Models::AllocationLineSummaryShipping
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::AllocationLineSummaryShipping
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
A simplified view on order financial details. Represents the shipping details for an order.
Instance Attribute Summary collapse
-
#discount ⇒ Object
readonly
Returns the value of attribute discount.
-
#duties ⇒ Object
readonly
Returns the value of attribute duties.
-
#duties_subsidy ⇒ Object
readonly
Returns the value of attribute duties_subsidy.
-
#subtotal ⇒ Object
readonly
Returns the value of attribute subtotal.
-
#tax ⇒ Object
readonly
Returns the value of attribute tax.
-
#tax_subsidy ⇒ Object
readonly
Returns the value of attribute tax_subsidy.
-
#total ⇒ Object
readonly
Returns the value of attribute total.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ AllocationLineSummaryShipping
constructor
A new instance of AllocationLineSummaryShipping.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ AllocationLineSummaryShipping
Returns a new instance of AllocationLineSummaryShipping.
28094 28095 28096 28097 28098 28099 28100 28101 28102 28103 28104 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28094 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:subtotal, :discount, :duties, :tax, :tax_subsidy, :duties_subsidy, :total], 'AllocationLineSummaryShipping') @subtotal = (x = opts.delete(:subtotal); x.is_a?(::Io::Flow::V0::Models::MoneyWithBase) ? x : ::Io::Flow::V0::Models::MoneyWithBase.new(x)) @discount = (x = opts.delete(:discount); x.is_a?(::Io::Flow::V0::Models::MoneyWithBase) ? x : ::Io::Flow::V0::Models::MoneyWithBase.new(x)) @duties = (x = opts.delete(:duties); x.is_a?(::Io::Flow::V0::Models::MoneyWithBase) ? x : ::Io::Flow::V0::Models::MoneyWithBase.new(x)) @tax = (x = opts.delete(:tax); x.is_a?(::Io::Flow::V0::Models::MoneyWithBase) ? x : ::Io::Flow::V0::Models::MoneyWithBase.new(x)) @tax_subsidy = (x = opts.delete(:tax_subsidy); x.is_a?(::Io::Flow::V0::Models::MoneyWithBase) ? x : ::Io::Flow::V0::Models::MoneyWithBase.new(x)) @duties_subsidy = (x = opts.delete(:duties_subsidy); x.is_a?(::Io::Flow::V0::Models::MoneyWithBase) ? x : ::Io::Flow::V0::Models::MoneyWithBase.new(x)) @total = (x = opts.delete(:total); x.is_a?(::Io::Flow::V0::Models::MoneyWithBase) ? x : ::Io::Flow::V0::Models::MoneyWithBase.new(x)) end |
Instance Attribute Details
#discount ⇒ Object (readonly)
Returns the value of attribute discount.
28092 28093 28094 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28092 def discount @discount end |
#duties ⇒ Object (readonly)
Returns the value of attribute duties.
28092 28093 28094 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28092 def duties @duties end |
#duties_subsidy ⇒ Object (readonly)
Returns the value of attribute duties_subsidy.
28092 28093 28094 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28092 def duties_subsidy @duties_subsidy end |
#subtotal ⇒ Object (readonly)
Returns the value of attribute subtotal.
28092 28093 28094 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28092 def subtotal @subtotal end |
#tax ⇒ Object (readonly)
Returns the value of attribute tax.
28092 28093 28094 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28092 def tax @tax end |
#tax_subsidy ⇒ Object (readonly)
Returns the value of attribute tax_subsidy.
28092 28093 28094 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28092 def tax_subsidy @tax_subsidy end |
#total ⇒ Object (readonly)
Returns the value of attribute total.
28092 28093 28094 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28092 def total @total end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
28110 28111 28112 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28110 def copy(incoming={}) AllocationLineSummaryShipping.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
28114 28115 28116 28117 28118 28119 28120 28121 28122 28123 28124 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28114 def to_hash { :subtotal => subtotal.to_hash, :discount => discount.to_hash, :duties => duties.to_hash, :tax => tax.to_hash, :tax_subsidy => tax_subsidy.to_hash, :duties_subsidy => duties_subsidy.to_hash, :total => total.to_hash } end |
#to_json ⇒ Object
28106 28107 28108 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28106 def to_json JSON.dump(to_hash) end |