Class: Basis
- Inherits:
-
Object
- Object
- Basis
- Defined in:
- lib/basis.rb
Instance Attribute Summary collapse
-
#anlage ⇒ Object
readonly
Returns the value of attribute anlage.
-
#basis_pa ⇒ Object
writeonly
Sets the attribute basis_pa.
-
#debug ⇒ Object
writeonly
Sets the attribute debug.
-
#eigenbeitrag ⇒ Object
readonly
Returns the value of attribute eigenbeitrag.
-
#rendite ⇒ Object
readonly
Returns the value of attribute rendite.
-
#steuerklasse ⇒ Object
writeonly
Sets the attribute steuerklasse.
-
#zulage ⇒ Object
readonly
Returns the value of attribute zulage.
Instance Method Summary collapse
-
#initialize(bruttojahresgehalt) ⇒ Basis
constructor
A new instance of Basis.
- #run ⇒ Object
Constructor Details
#initialize(bruttojahresgehalt) ⇒ Basis
Returns a new instance of Basis.
11 12 13 14 15 16 17 |
# File 'lib/basis.rb', line 11 def initialize(bruttojahresgehalt) @debug = false @brutto_pa = bruttojahresgehalt @basis_pa = 20000 @steuerklasse = 1 @plusdings = 50 # damit das ergebis besser stimmt end |
Instance Attribute Details
#anlage ⇒ Object (readonly)
Returns the value of attribute anlage.
6 7 8 |
# File 'lib/basis.rb', line 6 def anlage @anlage end |
#basis_pa=(value) ⇒ Object (writeonly)
Sets the attribute basis_pa
7 8 9 |
# File 'lib/basis.rb', line 7 def basis_pa=(value) @basis_pa = value end |
#debug=(value) ⇒ Object (writeonly)
Sets the attribute debug
7 8 9 |
# File 'lib/basis.rb', line 7 def debug=(value) @debug = value end |
#eigenbeitrag ⇒ Object (readonly)
Returns the value of attribute eigenbeitrag.
6 7 8 |
# File 'lib/basis.rb', line 6 def eigenbeitrag @eigenbeitrag end |
#rendite ⇒ Object (readonly)
Returns the value of attribute rendite.
6 7 8 |
# File 'lib/basis.rb', line 6 def rendite @rendite end |
#steuerklasse=(value) ⇒ Object (writeonly)
Sets the attribute steuerklasse
7 8 9 |
# File 'lib/basis.rb', line 7 def steuerklasse=(value) @steuerklasse = value end |
#zulage ⇒ Object (readonly)
Returns the value of attribute zulage.
6 7 8 |
# File 'lib/basis.rb', line 6 def zulage @zulage end |
Instance Method Details
#run ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/basis.rb', line 23 def run @lzzfreib = (@basis_pa/100)*72 p1 = { :lzz => 1, :re4 => @brutto_pa*100, :stkl => @steuerklasse, :r => 0, :lzzfreib => @lzzfreib*100, :krv => 0 } p1e = BMF::Abgabenrechner.new(p1).ausgaben p2 = { :lzz => 1, :re4 => @brutto_pa*100, :stkl => @steuerklasse, :r => 0, :lzzfreib => 0, :krv => 0 } p2e = BMF::Abgabenrechner.new(p2).ausgaben @zulage = ((p2e[:lstlzz]-p1e[:lstlzz])/100)+@plusdings @anlage = @basis_pa @rendite = (@zulage*100)/@basis_pa @eigenbeitrag= @anlage-@zulage if @debug puts "#{((p2e[:lstlzz]-p1e[:lstlzz])/100)+@plusdings} euro forderung" puts "#{@basis_pa} euro gehen in die anlage" puts "#{(p2e[:lstlzz]-p1e[:lstlzz])/@basis_pa}% Rendite" end end |