Class: MT940::Parser
- Inherits:
-
Object
- Object
- MT940::Parser
- Defined in:
- lib/mt940/parser.rb
Instance Attribute Summary collapse
-
#transactions ⇒ Object
Returns the value of attribute transactions.
Instance Method Summary collapse
-
#initialize(file) ⇒ Parser
constructor
A new instance of Parser.
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
#transactions ⇒ Object
Returns the value of attribute transactions.
8 9 10 |
# File 'lib/mt940/parser.rb', line 8 def transactions @transactions end |