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