Class: BlendSpreadsheetLoanGenerator::RealisticInterests
- Inherits:
-
Object
- Object
- BlendSpreadsheetLoanGenerator::RealisticInterests
- Includes:
- SpreadsheetConcern
- Defined in:
- lib/blend_spreadsheet_loan_generator/realistic_interests.rb
Instance Attribute Summary collapse
-
#loan ⇒ Object
Returns the value of attribute loan.
Instance Method Summary collapse
-
#initialize(loan:) ⇒ RealisticInterests
constructor
A new instance of RealisticInterests.
- #period_fees_rate_formula(line:) ⇒ Object
- #period_rate_formula(line:) ⇒ Object
Constructor Details
#initialize(loan:) ⇒ RealisticInterests
Returns a new instance of RealisticInterests.
6 7 8 |
# File 'lib/blend_spreadsheet_loan_generator/realistic_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/realistic_interests.rb', line 5 def loan @loan end |
Instance Method Details
#period_fees_rate_formula(line:) ⇒ Object
14 15 16 |
# File 'lib/blend_spreadsheet_loan_generator/realistic_interests.rb', line 14 def period_fees_rate_formula(line:) "=#{excel_float(loan.fees_rate)} * ((#{period_leap_days(line)} / 366) + (#{period_non_leap_days(line)} / 365))" end |
#period_rate_formula(line:) ⇒ Object
10 11 12 |
# File 'lib/blend_spreadsheet_loan_generator/realistic_interests.rb', line 10 def period_rate_formula(line:) "=#{excel_float(loan.rate)} * ((#{period_leap_days(line)} / 366) + (#{period_non_leap_days(line)} / 365))" end |