Class: Taxedo::Builder::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/taxedo/builder/base.rb

Direct Known Subclasses

Hash, Html, Text

Instance Method Summary collapse

Constructor Details

#initialize(receipt) ⇒ Base

Returns a new instance of Base.



2
3
4
5
# File 'lib/taxedo/builder/base.rb', line 2

def initialize(receipt)
  @receipt = receipt
  @content = []
end

Instance Method Details

#price(amount) ⇒ Object



7
8
9
# File 'lib/taxedo/builder/base.rb', line 7

def price(amount)
  Taxedo::Builder::Price.price(amount, unit: @receipt.currency)
end

#subtotalObject



11
12
13
# File 'lib/taxedo/builder/base.rb', line 11

def subtotal
  @receipt.subtotal
end

#t(path) ⇒ Object



15
16
17
# File 'lib/taxedo/builder/base.rb', line 15

def t(path)
  @receipt.t(path)
end

#taxesObject



19
20
21
# File 'lib/taxedo/builder/base.rb', line 19

def taxes
  @receipt.taxes
end

#totalObject



23
24
25
# File 'lib/taxedo/builder/base.rb', line 23

def total
  @receipt.total
end