Class: BlendSpreadsheetLoanGenerator::SimpleInterests

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(loan:) ⇒ SimpleInterests

Returns a new instance of SimpleInterests.



6
7
8
# File 'lib/blend_spreadsheet_loan_generator/simple_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/simple_interests.rb', line 5

def loan
  @loan
end

Instance Method Details

#period_fees_rate_formulaObject



14
15
16
# File 'lib/blend_spreadsheet_loan_generator/simple_interests.rb', line 14

def period_fees_rate_formula(*)
  "=#{excel_float(loan.fees_rate)} * #{loan.period_duration} / 12,0"
end

#period_rate_formulaObject



10
11
12
# File 'lib/blend_spreadsheet_loan_generator/simple_interests.rb', line 10

def period_rate_formula(*)
  "=#{excel_float(loan.rate)} * #{loan.period_duration} / 12,0"
end