Class: Planik::Lohnausweis::Daten::Block

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(eintraege, titel_leiste = nil) ⇒ Block

Returns a new instance of Block.



10
11
12
# File 'lib/lohnausweis/daten.rb', line 10

def initialize eintraege, titel_leiste = nil
  @eintraege, @titel_leiste = eintraege, titel_leiste
end

Instance Attribute Details

#eintraegeObject (readonly)

Returns the value of attribute eintraege.



8
9
10
# File 'lib/lohnausweis/daten.rb', line 8

def eintraege
  @eintraege
end

#titel_leisteObject (readonly)

Returns the value of attribute titel_leiste.



7
8
9
# File 'lib/lohnausweis/daten.rb', line 7

def titel_leiste
  @titel_leiste
end

Instance Method Details

#datenObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/lohnausweis/daten.rb', line 14

def daten
  d = []
  d << titel_leiste unless titel_leiste.nil?

  eintraege.each do |e|
    x = []
    x << e.name
    x << e.menge_to_s
    x << e.ansatz_to_s
    x << e.betrag_gerundet_to_s
    d << x
  end
  d
end