module Ldgr # Builds a transaction # # Examples # # Transaction.new do |t| # t.payee = "Something" # t.amount = 1000 # t.date = Date.today + 1 # end # # => # # Returns a transaction. class Transaction attr_accessor :payee, :amount, :account, :equity, :date, :currency, :cleared def initialize(&block) yield self if block_given? end def to_s <<~HERE #{date} #{cleared}#{payee} #{account} #{currency}#{amount} #{equity} HERE end end end