Class: Lite::Report::Hash

Inherits:
Base
  • Object
show all
Defined in:
lib/lite/report/hash.rb

Instance Method Summary collapse

Methods inherited from Base

export, import, #initialize

Constructor Details

This class inherits a constructor from Lite::Report::Base

Instance Method Details

#exportObject



5
6
7
8
# File 'lib/lite/report/hash.rb', line 5

def export
  assign_headers_to_csv_options!
  generate_or_stream_export!
end

#importObject



10
11
12
13
14
15
16
17
18
# File 'lib/lite/report/hash.rb', line 10

def import
  CSV.foreach(@data, @csv_options)
     .with_object([]) do |row, array|
       next if header_row?(row)

       row = convert_to_hash!(row)
       array << process_import_row!(row)
     end
end