Class: Taxedo::Builder::Base
- Inherits:
-
Object
- Object
- Taxedo::Builder::Base
- Defined in:
- lib/taxedo/builder/base.rb
Instance Method Summary collapse
-
#initialize(receipt) ⇒ Base
constructor
A new instance of Base.
- #price(amount) ⇒ Object
- #subtotal ⇒ Object
- #t(path) ⇒ Object
- #taxes ⇒ Object
- #total ⇒ Object
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 |
#subtotal ⇒ Object
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 |
#taxes ⇒ Object
19 20 21 |
# File 'lib/taxedo/builder/base.rb', line 19 def taxes @receipt.taxes end |
#total ⇒ Object
23 24 25 |
# File 'lib/taxedo/builder/base.rb', line 23 def total @receipt.total end |