Class: Investment
- Inherits:
-
Object
- Object
- Investment
- Defined in:
- lib/investment.rb
Instance Attribute Summary collapse
-
#i ⇒ Object
readonly
i - Zinssatz ( i = p / 100 ).
-
#inflation ⇒ Object
Returns the value of attribute inflation.
-
#k0 ⇒ Object
Returns the value of attribute k0.
-
#n ⇒ Object
Returns the value of attribute n.
-
#p ⇒ Object
Returns the value of attribute p.
-
#r(*rate) ⇒ Object
r - Rente / Rate.
Instance Method Summary collapse
-
#initialize ⇒ Investment
constructor
A new instance of Investment.
-
#kn ⇒ Object
Kn - Endkapital zinseszinslicher Verzinsung.
-
#kn_einfach ⇒ Object
Kn - Endkapital einfacher Verzinsung.
-
#q ⇒ Object
q - Aufzinsungsfaktor ( q = 1 + i ).
- #qn ⇒ Object
-
#r0 ⇒ Object
Barwert der nachschussigen ewigen Rente.
-
#rbf ⇒ Object
Die nachschüssige Rentenbarwertformel (RBF) lautet.
-
#rn ⇒ Object
Rn - Endwert der nachschüssigen Rente.
-
#v ⇒ Object
v - Abzinsungsfaktor (v = 1 / q ).
Constructor Details
#initialize ⇒ Investment
Returns a new instance of Investment.
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/investment.rb', line 15 def initialize # p - Zinssatz in Prozent @p = 0.0 @inflation = 0.0 # K0 - Anfangskapital @k0 = 0 # n - Laufzeit (Jahre, Monate, Tage # n - Anzahl der Rückzahlungsperioden @n = 0 end |
Instance Attribute Details
#i ⇒ Object (readonly)
i - Zinssatz ( i = p / 100 )
59 60 61 |
# File 'lib/investment.rb', line 59 def i @i end |
#inflation ⇒ Object
Returns the value of attribute inflation.
2 3 4 |
# File 'lib/investment.rb', line 2 def inflation @inflation end |
#k0 ⇒ Object
Returns the value of attribute k0.
2 3 4 |
# File 'lib/investment.rb', line 2 def k0 @k0 end |
#n ⇒ Object
Returns the value of attribute n.
2 3 4 |
# File 'lib/investment.rb', line 2 def n @n end |
#p ⇒ Object
Returns the value of attribute p.
2 3 4 |
# File 'lib/investment.rb', line 2 def p @p end |
#r(*rate) ⇒ Object
r - Rente / Rate
32 33 34 |
# File 'lib/investment.rb', line 32 def r @r end |
Instance Method Details
#kn ⇒ Object
Kn - Endkapital zinseszinslicher Verzinsung
65 66 67 |
# File 'lib/investment.rb', line 65 def kn k0*qn end |
#kn_einfach ⇒ Object
Kn - Endkapital einfacher Verzinsung
71 72 73 |
# File 'lib/investment.rb', line 71 def kn_einfach k0*(1+(i*n)) end |
#q ⇒ Object
q - Aufzinsungsfaktor ( q = 1 + i )
42 43 44 |
# File 'lib/investment.rb', line 42 def q 1+i end |
#qn ⇒ Object
47 48 49 |
# File 'lib/investment.rb', line 47 def qn q**n end |
#r0 ⇒ Object
Barwert der nachschussigen ewigen Rente
89 90 91 |
# File 'lib/investment.rb', line 89 def r0 r/i end |
#rbf ⇒ Object
Die nachschüssige Rentenbarwertformel (RBF) lautet
83 84 85 |
# File 'lib/investment.rb', line 83 def rbf rn*(1/qn) end |
#rn ⇒ Object
Rn - Endwert der nachschüssigen Rente
77 78 79 |
# File 'lib/investment.rb', line 77 def rn r*((qn-1)/(q-1)) end |
#v ⇒ Object
v - Abzinsungsfaktor (v = 1 / q )
53 54 55 |
# File 'lib/investment.rb', line 53 def v 1/q end |