class FinanceEngine::Equity

Public Class Methods

ggm_dividend(hash) click to toggle source
# File lib/finance_engine/gordon_growth_model.rb, line 14
def self.ggm_dividend(hash)
        hash[:value] * (hash[:rate] - hash[:growth])
end
ggm_growth(hash) click to toggle source
# File lib/finance_engine/gordon_growth_model.rb, line 22
def self.ggm_growth(hash)
        hash[:rate] - (hash[:dividend] / hash[:value])
end
ggm_rate(hash) click to toggle source
# File lib/finance_engine/gordon_growth_model.rb, line 18
def self.ggm_rate(hash)
        hash[:growth] + (hash[:dividend] / hash[:value])
end
ggm_value(hash) click to toggle source
# File lib/finance_engine/gordon_growth_model.rb, line 10
def self.ggm_value(hash)
        hash[:dividend] / (hash[:rate] - hash[:growth])
end
gordon_growth_model(hash) click to toggle source
# File lib/finance_engine/gordon_growth_model.rb, line 3
def self.gordon_growth_model(hash)
        return ggm_value(hash) if hash[:value].nil?
        return ggm_dividend(hash) if hash[:dividend].nil?
        return ggm_rate(hash) if hash[:rate].nil?
        return ggm_growth(hash) if hash[:growth].nil?
end