Class: InssCalculator::EigthDiscountCalculator

Inherits:
DiscountCalculatorBase show all
Defined in:
lib/inss_calculator/eigth_discount_calculator.rb

Overview

EigthDiscountCalculator calculates between its range limit As the limit is infinity, it always eacrease the contribution.

Constant Summary collapse

QUOTATION =
0.22

Constants inherited from DiscountCalculatorBase

DiscountCalculatorBase::NO_CONTRIBUTION, DiscountCalculatorBase::SALARY_BASE

Instance Attribute Summary

Attributes inherited from DiscountCalculatorBase

#salary

Instance Method Summary collapse

Methods inherited from DiscountCalculatorBase

#initialize

Constructor Details

This class inherits a constructor from InssCalculator::DiscountCalculatorBase

Instance Method Details

#contributionObject



9
10
11
12
13
14
15
# File 'lib/inss_calculator/eigth_discount_calculator.rb', line 9

def contribution
  return NO_CONTRIBUTION if salary <= salary_base

  return full_contribution if salary > salary_limit

  calculate_contribution
end