Class: Hbtrack::Importer::StreaksImporter
- Inherits:
-
AbstractImporter
- Object
- AbstractImporter
- Hbtrack::Importer::StreaksImporter
- Defined in:
- lib/hbtrack/importer/streaks_importer.rb
Constant Summary collapse
Instance Method Summary collapse
-
#import_from(file) ⇒ Object
Import and parse the CSV from Streaks.
Methods inherited from AbstractImporter
Constructor Details
This class inherits a constructor from Hbtrack::Importer::AbstractImporter
Instance Method Details
#import_from(file) ⇒ Object
Import and parse the CSV from Streaks
14 15 16 17 18 19 20 21 |
# File 'lib/hbtrack/importer/streaks_importer.rb', line 14 def import_from(file) raise 'File not found' unless File.exist?(file) CSV.foreach(file, headers: true) do |row| extract_streaks_data(row) end # Handle the parsed data [@habits, @entries] end |