Class: BlendSpreadsheetLoanGenerator::NormalInterests

Inherits:
Object
  • Object
show all
Includes:
SpreadsheetConcern
Defined in:
lib/blend_spreadsheet_loan_generator/normal_interests.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#loanObject

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_formulaObject



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_formulaObject



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