Class: QuickenParser::Transaction

Inherits:
Object
  • Object
show all
Defined in:
lib/quicken_parser/transaction.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ Transaction

Returns a new instance of Transaction.



5
6
7
8
9
10
11
# File 'lib/quicken_parser/transaction.rb', line 5

def initialize(args={})
  args.each_pair do |key, value|
    send("#{key}=", value)
  end

  @memo = nil if @name.to_s.strip == @memo.to_s.strip
end

Instance Attribute Details

#amountObject

Returns the value of attribute amount.



3
4
5
# File 'lib/quicken_parser/transaction.rb', line 3

def amount
  @amount
end

#memoObject

Returns the value of attribute memo.



3
4
5
# File 'lib/quicken_parser/transaction.rb', line 3

def memo
  @memo
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/quicken_parser/transaction.rb', line 3

def name
  @name
end

#numberObject

Returns the value of attribute number.



3
4
5
# File 'lib/quicken_parser/transaction.rb', line 3

def number
  @number
end

#timestampObject

Returns the value of attribute timestamp.



3
4
5
# File 'lib/quicken_parser/transaction.rb', line 3

def timestamp
  @timestamp
end

#typeObject

Returns the value of attribute type.



3
4
5
# File 'lib/quicken_parser/transaction.rb', line 3

def type
  @type
end

Instance Method Details

#to_sObject



13
14
15
# File 'lib/quicken_parser/transaction.rb', line 13

def to_s
  "%s: %s %s %s" % [timestamp.to_s, type, name, amount.to_s]
end