Class: Taxedo::Tax
- Inherits:
-
Object
- Object
- Taxedo::Tax
- Defined in:
- lib/taxedo/tax.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#rate ⇒ Object
Returns the value of attribute rate.
-
#source_amount ⇒ Object
Returns the value of attribute source_amount.
Instance Method Summary collapse
- #amount ⇒ Object
-
#initialize(id) ⇒ Tax
constructor
A new instance of Tax.
- #subtotal ⇒ Object
Constructor Details
#initialize(id) ⇒ Tax
Returns a new instance of Tax.
5 6 7 8 |
# File 'lib/taxedo/tax.rb', line 5 def initialize(id) @id = id @amount = 0 end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/taxedo/tax.rb', line 3 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
2 3 4 |
# File 'lib/taxedo/tax.rb', line 2 def name @name end |
#rate ⇒ Object
Returns the value of attribute rate.
2 3 4 |
# File 'lib/taxedo/tax.rb', line 2 def rate @rate end |
#source_amount ⇒ Object
Returns the value of attribute source_amount.
3 4 5 |
# File 'lib/taxedo/tax.rb', line 3 def source_amount @source_amount end |
Instance Method Details
#amount ⇒ Object
10 11 12 |
# File 'lib/taxedo/tax.rb', line 10 def amount @amount end |
#subtotal ⇒ Object
19 20 21 |
# File 'lib/taxedo/tax.rb', line 19 def subtotal @source_amount + @amount end |