Class: Processor
- Inherits:
-
Object
- Object
- Processor
- Defined in:
- lib/csv2qif/processor.rb
Class Method Summary collapse
Class Method Details
.init ⇒ Object
6 7 8 |
# File 'lib/csv2qif/processor.rb', line 6 def init @qif = QIF.new end |
.process(stdin, stdout, arguments, options) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/csv2qif/processor.rb', line 10 def process stdin, stdout, arguments, if arguments.empty? process_file stdin, stdout, else arguments.each do |file| mode = ['r', [:encoding]].compact.join(':') stream_in = File.open(file, mode) stream_out = File.new esub(file, :csv, :qif), "w" begin process_file stream_in, stream_out, ensure stream_in.close stream_out.close end end end end |