Class: BankOCR::ReportGenerator
- Inherits:
-
Object
- Object
- BankOCR::ReportGenerator
- Defined in:
- lib/report_generator.rb
Overview
Creates a text file with generated report
Instance Method Summary collapse
-
#initialize(output_path, account_numbers) ⇒ ReportGenerator
constructor
A new instance of ReportGenerator.
- #save! ⇒ Object
Constructor Details
#initialize(output_path, account_numbers) ⇒ ReportGenerator
Returns a new instance of ReportGenerator.
4 5 6 7 |
# File 'lib/report_generator.rb', line 4 def initialize(output_path, account_numbers) @output_path = output_path @account_numbers = account_numbers end |
Instance Method Details
#save! ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/report_generator.rb', line 9 def save! file = File.open(@output_path, 'w+') @account_numbers.each do |account| file.write "#{account}#{error(account)}\n" end file.close end |