Class: Io::Flow::V0::Models::AllocationLineSummaryLineItem
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::AllocationLineSummaryLineItem
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
A simplified view on order financial details. Represents a single line on 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.
-
#item_number ⇒ Object
readonly
Returns the value of attribute item_number.
-
#line_number ⇒ Object
readonly
Returns the value of attribute line_number.
-
#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 = {}) ⇒ AllocationLineSummaryLineItem
constructor
A new instance of AllocationLineSummaryLineItem.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ AllocationLineSummaryLineItem
Returns a new instance of AllocationLineSummaryLineItem.
26473 26474 26475 26476 26477 26478 26479 26480 26481 26482 26483 26484 26485 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26473 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:item_number, :subtotal, :discount, :duties, :tax, :tax_subsidy, :duties_subsidy, :total], 'AllocationLineSummaryLineItem') @item_number = HttpClient::Preconditions.assert_class('item_number', opts.delete(:item_number), String) @line_number = (x = opts.delete(:line_number); x.nil? ? nil : HttpClient::Preconditions.assert_class('line_number', x, String)) @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.
26471 26472 26473 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26471 def discount @discount end |
#duties ⇒ Object (readonly)
Returns the value of attribute duties.
26471 26472 26473 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26471 def duties @duties end |
#duties_subsidy ⇒ Object (readonly)
Returns the value of attribute duties_subsidy.
26471 26472 26473 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26471 def duties_subsidy @duties_subsidy end |
#item_number ⇒ Object (readonly)
Returns the value of attribute item_number.
26471 26472 26473 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26471 def item_number @item_number end |
#line_number ⇒ Object (readonly)
Returns the value of attribute line_number.
26471 26472 26473 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26471 def line_number @line_number end |
#subtotal ⇒ Object (readonly)
Returns the value of attribute subtotal.
26471 26472 26473 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26471 def subtotal @subtotal end |
#tax ⇒ Object (readonly)
Returns the value of attribute tax.
26471 26472 26473 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26471 def tax @tax end |
#tax_subsidy ⇒ Object (readonly)
Returns the value of attribute tax_subsidy.
26471 26472 26473 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26471 def tax_subsidy @tax_subsidy end |
#total ⇒ Object (readonly)
Returns the value of attribute total.
26471 26472 26473 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26471 def total @total end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
26491 26492 26493 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26491 def copy(incoming={}) AllocationLineSummaryLineItem.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
26495 26496 26497 26498 26499 26500 26501 26502 26503 26504 26505 26506 26507 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26495 def to_hash { :item_number => item_number, :line_number => line_number, :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
26487 26488 26489 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26487 def to_json JSON.dump(to_hash) end |