lib/datev/export.rb in datev-0.1.1 vs lib/datev/export.rb in datev-0.2.0

- old
+ new

@@ -10,25 +10,25 @@ 'DATEV-Format-KZ' => 'EXTF', 'Versionsnummer' => 510, 'Datenkategorie' => 21, 'Formatname' => 'Buchungsstapel', 'Formatversion' => 7, - 'Erzeugt am' => Time.now, + 'Erzeugt am' => Time.now.utc, 'Sachkontenlänge' => 4, 'Bezeichnung' => 'Buchungen', 'Buchungstyp' => 1, 'WKZ' => 'EUR' } def initialize(header_attributes) + raise ArgumentError.new('Hash required') unless header_attributes.is_a?(Hash) + @header = Header.new DEFAULT_HEADER_ATTRIBUTES.merge(header_attributes) @rows = [] end - def <<(booking) - raise ArgumentError.new('Param must be a Datev::Booking instance') unless booking.is_a?(Booking) - - @rows << booking + def <<(attributes) + @rows << Datev::Booking.new(attributes) end def to_s CSV.generate(CSV_OPTIONS) do |csv| write(csv)