lib/ledger_gen/transaction.rb in ledger_gen-0.1.0 vs lib/ledger_gen/transaction.rb in ledger_gen-0.1.1

- old
+ new

@@ -1,8 +1,9 @@ module LedgerGen class Transaction - def initialize + def initialize(date_format=nil) + @date_format = date_format || '%Y/%m/%d' @postings = [] @comments = [] end def date(date) @@ -50,10 +51,10 @@ end private def date_string - @date.strftime("%Y/%m/%d") + @date.strftime(date_format) end def cleared_string @cleared ? ' *' : '' end