Class: YnabConvert::File
- Inherits:
-
Object
- Object
- YnabConvert::File
- Includes:
- YnabLogger
- Defined in:
- lib/ynab_convert.rb
Overview
Operations on the CSV file to convert
Instance Method Summary collapse
-
#initialize(opts) ⇒ File
constructor
CSV file.
-
#to_ynab! ⇒ String
Converts @file to YNAB4 format and writes it to disk.
Methods included from YnabLogger
Constructor Details
#initialize(opts) ⇒ File
CSV file
33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/ynab_convert.rb', line 33 def initialize(opts) logger.debug opts.to_h @file = opts[:file] begin @processor = opts[:processor].new( filepath: @file ) rescue Errno::ENOENT handle_file_not_found end end |
Instance Method Details
#to_ynab! ⇒ String
Converts @file to YNAB4 format and writes it to disk
48 49 50 51 |
# File 'lib/ynab_convert.rb', line 48 def to_ynab! logger.debug "Processing `#{@file}' through `#{@processor.class.name}'" @processor.to_ynab! end |