Sha256: 8a3203f6d0f43fece4739173af2f30be5a970889464c256f9f623c480d9fb2cb
Contents?: true
Size: 424 Bytes
Versions: 2
Compression:
Stored size: 424 Bytes
Contents
class Transaction attr_reader :total, :date, :description, :type, :saldo def initialize(hash) @total = hash[:total] @date = hash[:date] @description = clean_utf(hash[:description]) @saldo = hash[:saldo] end def income? total > 0 end def outcome? total < 0 end private def clean_utf(string) string.encode('UTF-16', 'UTF-8', :invalid => :replace, :replace => '').encode!('UTF-8','UTF-16') end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
cartolify-0.4.1 | lib/cartolify/transaction.rb |
cartolify-0.4 | lib/cartolify/transaction.rb |