Class: FinModeling::ReOIValuation

Inherits:
Object
  • Object
show all
Defined in:
lib/finmodeling/reoi_valuation.rb

Instance Method Summary collapse

Constructor Details

#initialize(filings, forecasts, cost_of_capital, num_shares) ⇒ ReOIValuation

Returns a new instance of ReOIValuation.



3
4
5
6
# File 'lib/finmodeling/reoi_valuation.rb', line 3

def initialize(filings, forecasts, cost_of_capital, num_shares)
  @filings, @forecasts, @cost_of_capital, @num_shares = [filings, forecasts, cost_of_capital, num_shares]
  @discount_rate  = FinModeling::DiscountRate.new(@cost_of_capital.value + 1.0)
end

Instance Method Details

#periodsObject



31
32
33
34
# File 'lib/finmodeling/reoi_valuation.rb', line 31

def periods
  @periods ||= [ @filings.re_bs_arr.last.period ] +
               @forecasts.reformulated_balance_sheets.map{ |x| x.period }
end

#summaryObject



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/finmodeling/reoi_valuation.rb', line 8

def summary
  s = CalculationSummary.new
  s.title = "ReOI Valuation"
  s.totals_row_enabled = false

  s.header_row = CalculationHeader.new(:key => "", :vals => periods.map{ |x| x.to_pretty_s + ((x.value > Date.today) ? "E" : "") })

  s.rows = [ ]

  s.rows << CalculationRow.new(:key => "ReOI ($MM)", :vals => reoi_vals.map{ |x| x ? x.to_nearest_million : nil })
  s.rows << CalculationRow.new(:key => "PV(ReOI) ($MM)", :vals => pv_reoi_vals.map{ |x| x ? x.to_nearest_million : nil })
  s.rows << CalculationRow.new(:key => "CV ($MM)", :vals => cv_vals.map{ |x| x ? x.to_nearest_million : nil })
  s.rows << CalculationRow.new(:key => "PV(CV) ($MM)", :vals => pv_cv_vals.map{ |x| x ? x.to_nearest_million : nil })
  s.rows << CalculationRow.new(:key => "Book Value of Common Equity ($MM)", :vals => bv_cse_vals.map{ |x| x ? x.to_nearest_million : nil })
  s.rows << CalculationRow.new(:key => "Enterprise Value ($MM)", :vals => ev_vals.map{ |x| x ? x.to_nearest_million : nil })
  s.rows << CalculationRow.new(:key => "NFA ($MM)", :vals => bv_nfa_vals.map{ |x| x ? x.to_nearest_million : nil })
  s.rows << CalculationRow.new(:key => "Value of Common Equity ($MM)", :vals => cse_vals.map{ |x| x ? x.to_nearest_million : nil })
  s.rows << CalculationRow.new(:key => "# Shares (MM)", :vals => num_shares_vals.map{ |x| x ? x.to_nearest_million : nil })
  s.rows << CalculationRow.new(:key => "Value / Share ($)", :vals => val_per_shares_vals.map{ |x| x ? x.to_nearest_dollar(num_decimals=2) : nil })

  return s
end