Class: InssCalculator::DiscountCalculatorBase

Inherits:
Object
  • Object
show all
Defined in:
lib/inss_calculator/discount_calculator_base.rb

Overview

DiscountCalculatorBase provide the common initializer for First, Second, Third and Fourth Discount calculators

Constant Summary collapse

NO_CONTRIBUTION =
0.0
SALARY_BASE =
0.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(salary) ⇒ DiscountCalculatorBase

Returns a new instance of DiscountCalculatorBase.



12
13
14
# File 'lib/inss_calculator/discount_calculator_base.rb', line 12

def initialize(salary)
  @salary = salary.to_f
end

Instance Attribute Details

#salaryObject (readonly)

Returns the value of attribute salary.



7
8
9
# File 'lib/inss_calculator/discount_calculator_base.rb', line 7

def salary
  @salary
end