Class: Taxedo::Tax

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#idObject (readonly)

Returns the value of attribute id.



3
4
5
# File 'lib/taxedo/tax.rb', line 3

def id
  @id
end

#nameObject

Returns the value of attribute name.



2
3
4
# File 'lib/taxedo/tax.rb', line 2

def name
  @name
end

#rateObject

Returns the value of attribute rate.



2
3
4
# File 'lib/taxedo/tax.rb', line 2

def rate
  @rate
end

#source_amountObject

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

#amountObject



10
11
12
# File 'lib/taxedo/tax.rb', line 10

def amount
  @amount
end

#subtotalObject



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

def subtotal
  @source_amount + @amount
end