Class: Fiscalizer::Tax

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#baseObject

Returns the value of attribute base.



9
10
11
# File 'lib/fiscalizer/data_objects/tax.rb', line 9

def base
  @base
end

#nameObject

Returns the value of attribute name.



9
10
11
# File 'lib/fiscalizer/data_objects/tax.rb', line 9

def name
  @name
end

#rateObject

Returns the value of attribute rate.



9
10
11
# File 'lib/fiscalizer/data_objects/tax.rb', line 9

def rate
  @rate
end

#summedObject

Returns the value of attribute summed.



9
10
11
# File 'lib/fiscalizer/data_objects/tax.rb', line 9

def summed
  @summed
end

#totalObject

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_strObject



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

def base_str
  format('%15.2f', base).strip
end

#rate_strObject



23
24
25
# File 'lib/fiscalizer/data_objects/tax.rb', line 23

def rate_str
  format('%3.2f', rate).strip
end

#summed_strObject



31
32
33
# File 'lib/fiscalizer/data_objects/tax.rb', line 31

def summed_str
  format('%15.2f', summed).strip
end

#total_strObject



27
28
29
# File 'lib/fiscalizer/data_objects/tax.rb', line 27

def total_str
  format('%15.2f', total).strip
end