Class: Fiscalizer::Tax
- Inherits:
-
Object
- Object
- Fiscalizer::Tax
- Defined in:
- lib/fiscalizer/data_objects/tax.rb
Instance Attribute Summary collapse
-
#base ⇒ Object
Returns the value of attribute base.
-
#name ⇒ Object
Returns the value of attribute name.
-
#rate ⇒ Object
Returns the value of attribute rate.
-
#summed ⇒ Object
Returns the value of attribute summed.
-
#total ⇒ Object
Returns the value of attribute total.
Instance Method Summary collapse
- #base_str ⇒ Object
-
#initialize(base:, rate:, name:) ⇒ Tax
constructor
A new instance of Tax.
- #rate_str ⇒ Object
- #summed_str ⇒ Object
- #total_str ⇒ Object
Constructor Details
#initialize(base:, rate:, name:) ⇒ Tax
Returns a new instance of Tax.
3 4 5 6 7 |
# File 'lib/fiscalizer/data_objects/tax.rb', line 3 def initialize(base:, rate:, name:) @base = base @rate = rate @name = name end |
Instance Attribute Details
#base ⇒ Object
Returns the value of attribute base.
9 10 11 |
# File 'lib/fiscalizer/data_objects/tax.rb', line 9 def base @base end |
#name ⇒ Object
Returns the value of attribute name.
9 10 11 |
# File 'lib/fiscalizer/data_objects/tax.rb', line 9 def name @name end |
#rate ⇒ Object
Returns the value of attribute rate.
9 10 11 |
# File 'lib/fiscalizer/data_objects/tax.rb', line 9 def rate @rate end |
#summed ⇒ Object
Returns the value of attribute summed.
9 10 11 |
# File 'lib/fiscalizer/data_objects/tax.rb', line 9 def summed @summed end |
#total ⇒ Object
Returns the value of attribute total.
9 10 11 |
# File 'lib/fiscalizer/data_objects/tax.rb', line 9 def total @total end |
Instance Method Details
#base_str ⇒ Object
19 20 21 |
# File 'lib/fiscalizer/data_objects/tax.rb', line 19 def base_str format('%15.2f', base).strip end |
#rate_str ⇒ Object
23 24 25 |
# File 'lib/fiscalizer/data_objects/tax.rb', line 23 def rate_str format('%3.2f', rate).strip end |
#summed_str ⇒ Object
31 32 33 |
# File 'lib/fiscalizer/data_objects/tax.rb', line 31 def summed_str format('%15.2f', summed).strip end |
#total_str ⇒ Object
27 28 29 |
# File 'lib/fiscalizer/data_objects/tax.rb', line 27 def total_str format('%15.2f', total).strip end |