Class: QuickenParser::Transactions

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/quicken_parser/transactions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ Transactions

Returns a new instance of Transactions.



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

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

Instance Attribute Details

#timespanObject

Returns the value of attribute timespan.



4
5
6
# File 'lib/quicken_parser/transactions.rb', line 4

def timespan
  @timespan
end

Instance Method Details

#<<(txn) ⇒ Object



26
27
28
# File 'lib/quicken_parser/transactions.rb', line 26

def <<(txn)
  @txns << txn
end

#eachObject



30
31
32
33
34
# File 'lib/quicken_parser/transactions.rb', line 30

def each
  @txns.each do |txn|
    yield txn
  end
end

#firstObject



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

def first
  @txns.first
end

#lastObject



17
18
19
# File 'lib/quicken_parser/transactions.rb', line 17

def last
  @txns.last
end

#lengthObject Also known as: size



21
22
23
# File 'lib/quicken_parser/transactions.rb', line 21

def length
  @txns.length
end