Class: VertexClient::Response::Quotation

Inherits:
Base
  • Object
show all
Defined in:
lib/vertex_client/responses/quotation.rb

Direct Known Subclasses

Invoice, QuotationFallback

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from VertexClient::Response::Base

Instance Method Details

#line_itemsObject



17
18
19
20
21
22
23
24
25
26
# File 'lib/vertex_client/responses/quotation.rb', line 17

def line_items
  @line_items ||= normalized_line_items.map do |line_item|
    LineItem.new(
      product:        product_for_line_item(line_item[:product]),
      quantity:       line_item[:quantity],
      price:          line_item[:extended_price],
      total_tax:      tax_for_line_item(line_item)
    )
  end
end

#subtotalObject



5
6
7
# File 'lib/vertex_client/responses/quotation.rb', line 5

def subtotal
  @subtotal ||= BigDecimal.new(@body[:sub_total])
end

#totalObject



13
14
15
# File 'lib/vertex_client/responses/quotation.rb', line 13

def total
  @total ||= BigDecimal.new(@body[:total])
end

#total_taxObject



9
10
11
# File 'lib/vertex_client/responses/quotation.rb', line 9

def total_tax
  @total_tax ||= BigDecimal.new(@body[:total_tax])
end