Class: VertexClient::Response::QuotationFallback
- Defined in:
- lib/vertex_client/responses/quotation_fallback.rb
Instance Method Summary collapse
-
#initialize(payload) ⇒ QuotationFallback
constructor
A new instance of QuotationFallback.
- #subtotal ⇒ Object
- #total ⇒ Object
- #total_tax ⇒ Object
Methods inherited from Quotation
Constructor Details
#initialize(payload) ⇒ QuotationFallback
Returns a new instance of QuotationFallback.
5 6 7 |
# File 'lib/vertex_client/responses/quotation_fallback.rb', line 5 def initialize(payload) @body = payload.body end |
Instance Method Details
#subtotal ⇒ Object
9 10 11 |
# File 'lib/vertex_client/responses/quotation_fallback.rb', line 9 def subtotal @subtotal || line_items.sum(&:price) end |
#total ⇒ Object
17 18 19 |
# File 'lib/vertex_client/responses/quotation_fallback.rb', line 17 def total @total ||= subtotal + total_tax end |
#total_tax ⇒ Object
13 14 15 |
# File 'lib/vertex_client/responses/quotation_fallback.rb', line 13 def total_tax @total_tax ||= line_items.sum(&:total_tax).floor(2) end |