Class: RedshiftConnector::Reader::Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/redshift_connector/reader/abstract.rb

Direct Known Subclasses

CSV, RedshiftCSV, TSV

Constant Summary collapse

READER_CLASSES =

=> Class

{}

Class Method Summary collapse

Class Method Details

.declare_reader(id) ⇒ Object



5
6
7
# File 'lib/redshift_connector/reader/abstract.rb', line 5

def self.declare_reader(id)
  READER_CLASSES[id.to_sym] = self
end

.get_reader_class(id) ⇒ Object



9
10
11
12
# File 'lib/redshift_connector/reader/abstract.rb', line 9

def self.get_reader_class(id)
  READER_CLASSES[id.to_sym] or
      raise ArgumentError, "unknown data file reader type: #{id.inspect}"
end