Class: Itiel::Extract::DatabaseTable

Inherits:
CustomSQL
  • Object
show all
Defined in:
lib/itiel/extract/database_table.rb

Overview

Extracts all the contents from a Database table into the stream and passes it on to it’s next_step

Usage:

@extractor            = Itiel::Extract::DatabaseTable.new
@extractor.connection = :test
@extractor.table_name = 'test_table'

Instance Attribute Summary collapse

Attributes inherited from CustomSQL

#script

Attributes included from Nameable

#debug, #step_name

Attributes included from DB::SQLConnectable

#connection, #connection_file_path

Attributes included from ChainedStep

#next_step

Instance Method Summary collapse

Methods inherited from CustomSQL

#initialize

Methods included from DB::SQLConnectable

included

Methods included from ChainedStep

#start

Constructor Details

This class inherits a constructor from Itiel::Extract::CustomSQL

Instance Attribute Details

#table_nameObject

Returns the value of attribute table_name.



15
16
17
# File 'lib/itiel/extract/database_table.rb', line 15

def table_name
  @table_name
end

Instance Method Details

#extractObject



17
18
19
20
# File 'lib/itiel/extract/database_table.rb', line 17

def extract
  db = self.class.sequel_connection(connection)
  db[table_name.to_sym].all
end