Class: Investment

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeInvestment

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

#iObject (readonly)

i - Zinssatz ( i = p / 100 )



59
60
61
# File 'lib/investment.rb', line 59

def i
  @i
end

#inflationObject

Returns the value of attribute inflation.



2
3
4
# File 'lib/investment.rb', line 2

def inflation
  @inflation
end

#k0Object

Returns the value of attribute k0.



2
3
4
# File 'lib/investment.rb', line 2

def k0
  @k0
end

#nObject

Returns the value of attribute n.



2
3
4
# File 'lib/investment.rb', line 2

def n
  @n
end

#pObject

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

#knObject

Kn - Endkapital zinseszinslicher Verzinsung



65
66
67
# File 'lib/investment.rb', line 65

def kn
  k0*qn
end

#kn_einfachObject

Kn - Endkapital einfacher Verzinsung



71
72
73
# File 'lib/investment.rb', line 71

def kn_einfach
  k0*(1+(i*n))
end

#qObject

q - Aufzinsungsfaktor ( q = 1 + i )



42
43
44
# File 'lib/investment.rb', line 42

def q
  1+i
end

#qnObject



47
48
49
# File 'lib/investment.rb', line 47

def qn
  q**n
end

#r0Object

Barwert der nachschussigen ewigen Rente



89
90
91
# File 'lib/investment.rb', line 89

def r0
  r/i
end

#rbfObject

Die nachschüssige Rentenbarwertformel (RBF) lautet



83
84
85
# File 'lib/investment.rb', line 83

def rbf
  rn*(1/qn)
end

#rnObject

Rn - Endwert der nachschüssigen Rente



77
78
79
# File 'lib/investment.rb', line 77

def rn
  r*((qn-1)/(q-1))
end

#vObject

v - Abzinsungsfaktor (v = 1 / q )



53
54
55
# File 'lib/investment.rb', line 53

def v
  1/q
end