Class: MT940::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/mt940/parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file) ⇒ Parser

Returns a new instance of Parser.



10
11
12
13
14
15
16
17
18
# File 'lib/mt940/parser.rb', line 10

def initialize(file)
  file = File.open(file) if file.is_a?(String) 
  if file.is_a?(File) || file.is_a?(Tempfile)
    process(file)
    file.close
  else
    raise NoFileGiven.new('No file is given!')
  end
end

Instance Attribute Details

#transactionsObject

Returns the value of attribute transactions.



8
9
10
# File 'lib/mt940/parser.rb', line 8

def transactions
  @transactions
end