Class: Chronicle::ETL::TableLoader

Inherits:
Loader
  • Object
show all
Defined in:
lib/chronicle/etl/loaders/table_loader.rb

Instance Attribute Summary

Attributes included from Registry::SelfRegistering

#connector_registration

Instance Method Summary collapse

Methods inherited from Loader

#initialize, #start

Methods included from Registry::SelfRegistering

#register_connector

Methods included from Loaders::Helpers::EncodingHelper

#force_utf8

Methods included from Configurable

included

Constructor Details

This class inherits a constructor from Chronicle::ETL::Loader

Instance Method Details

#finishObject



26
27
28
29
30
31
32
33
# File 'lib/chronicle/etl/loaders/table_loader.rb', line 26

def finish
  return if records.empty?

  headers = gather_headers(records)
  rows = build_rows(records, headers)

  render_table(headers, rows)
end

#load(record) ⇒ Object



22
23
24
# File 'lib/chronicle/etl/loaders/table_loader.rb', line 22

def load(record)
  records << record
end

#recordsObject



35
36
37
# File 'lib/chronicle/etl/loaders/table_loader.rb', line 35

def records
  @records ||= []
end