Class: Planik::Lohnausweis::Abzug

Inherits:
Eintrag
  • Object
show all
Defined in:
lib/lohnausweis/daten_eintrag.rb

Instance Attribute Summary

Attributes inherited from Eintrag

#ansatz, #einheit, #menge, #name

Instance Method Summary collapse

Methods inherited from Eintrag

#betrag_gerundet_to_s

Constructor Details

#initialize(name, menge, ansatz) ⇒ Abzug

ansatz = prozent



103
104
105
# File 'lib/lohnausweis/daten_eintrag.rb', line 103

def initialize name, menge, ansatz
  super(name, menge, ansatz)
end

Instance Method Details

#ansatz_to_sObject



115
116
117
118
# File 'lib/lohnausweis/daten_eintrag.rb', line 115

def ansatz_to_s
  x = format('%.2f', ansatz)
  "#{x}%"
end

#betragObject



107
108
109
# File 'lib/lohnausweis/daten_eintrag.rb', line 107

def betrag
  menge * (ansatz / 100)
end

#menge_to_sObject



111
112
113
# File 'lib/lohnausweis/daten_eintrag.rb', line 111

def menge_to_s
  menge.nil? ? nil : value_gerundet_to_s(menge)
end