Class: BlendSpreadsheetLoanGenerator::NormalInterests
- Inherits:
-
Object
- Object
- BlendSpreadsheetLoanGenerator::NormalInterests
- Includes:
- SpreadsheetConcern
- Defined in:
- lib/blend_spreadsheet_loan_generator/normal_interests.rb
Instance Attribute Summary collapse
-
#loan ⇒ Object
Returns the value of attribute loan.
Instance Method Summary collapse
-
#initialize(loan:) ⇒ NormalInterests
constructor
A new instance of NormalInterests.
- #period_fees_rate_formula ⇒ Object
- #period_rate_formula ⇒ Object
Constructor Details
#initialize(loan:) ⇒ NormalInterests
Returns a new instance of NormalInterests.
6 7 8 |
# File 'lib/blend_spreadsheet_loan_generator/normal_interests.rb', line 6 def initialize(loan:) @loan = loan end |
Instance Attribute Details
#loan ⇒ Object
Returns the value of attribute loan.
5 6 7 |
# File 'lib/blend_spreadsheet_loan_generator/normal_interests.rb', line 5 def loan @loan end |
Instance Method Details
#period_fees_rate_formula ⇒ Object
16 17 18 19 |
# File 'lib/blend_spreadsheet_loan_generator/normal_interests.rb', line 16 def period_fees_rate_formula(*) periods_per_year = excel_float(12.0 / loan.period_duration) "=TAUX.NOMINAL(#{excel_float(loan.fees_rate)};#{periods_per_year}) / #{periods_per_year}" end |
#period_rate_formula ⇒ Object
10 11 12 13 |
# File 'lib/blend_spreadsheet_loan_generator/normal_interests.rb', line 10 def period_rate_formula(*) periods_per_year = excel_float(12.0 / loan.period_duration) "=TAUX.NOMINAL(#{excel_float(loan.rate)};#{periods_per_year}) / #{periods_per_year}" end |