Class: FileGenerator::Base
- Inherits:
-
Object
- Object
- FileGenerator::Base
- Defined in:
- lib/file_generator/base.rb
Instance Method Summary collapse
- #generate_file(records, headerformat, bodyformat, footerformat) ⇒ Object
-
#initialize ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize ⇒ Base
Returns a new instance of Base.
4 5 |
# File 'lib/file_generator/base.rb', line 4 def initialize() end |
Instance Method Details
#generate_file(records, headerformat, bodyformat, footerformat) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/file_generator/base.rb', line 7 def generate_file(records, headerformat, bodyformat, ) file = [] fh = process_hf(headerformat, records) file << fh records.each do |record| fb = process_body(bodyformat, record) file << fb end ff = process_hf(, records) file << ff file = file.join("\n") file end |