Sha256: 9cba0394bed7e255f1f9e8be8a4a6adfd38b71f0bcffaac8a9334e5a4abba5e3
Contents?: true
Size: 637 Bytes
Versions: 1
Compression:
Stored size: 637 Bytes
Contents
module LedgerGen class Journal attr_accessor :date_format def self.build journal = new yield journal return journal end def initialize @transactions = [] @date_format = '%Y/%m/%d' end def transaction txn = Transaction.new(date_format) @transactions << txn yield txn end def to_s @transactions.map(&:to_s).join("\n\n") + "\n" end def pretty_print(ledger_options='') IO.popen("ledger #{ledger_options} -f - print", mode='r+') do |io| io.write to_s io.close_write io.read end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
ledger_gen-0.2.0 | lib/ledger_gen/journal.rb |