Sha256: f428e25deb0a1803e5371ee2087b011667856e7929a4c83ad578968dd9d801c3

Contents?: true

Size: 670 Bytes

Versions: 4

Compression:

Stored size: 670 Bytes

Contents

module Bankscrap
  class Transaction
    include Utils::Inspectable

    attr_accessor :id, :amount, :currency,
                  :effective_date, :description,
                  :balance, :account

    def initialize(params = {})
      params.each { |key, value| send "#{key}=", value }
    end

    def to_s
      "#{effective_date.strftime('%d/%m/%Y')}   #{description.ljust(45)} #{amount.format.rjust(20)}"
    end

    def to_a
      [effective_date.strftime('%d/%m/%Y'), description, amount]
    end

    private

    def inspect_attributes
      [
        :id, :amount, :currency,
        :effective_date, :description,
        :balance
      ]
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
bankscrap-1.0.4 lib/bankscrap/transaction.rb
bankscrap-1.0.3 lib/bankscrap/transaction.rb
bankscrap-1.0.2 lib/bankscrap/transaction.rb
bankscrap-1.0.1 lib/bankscrap/transaction.rb