Class: ETL::Generator::Generator

Inherits:
Object
  • Object
show all
Defined in:
lib/etl/generator/generator.rb

Overview

Base class for generators.

Direct Known Subclasses

SurrogateKeyGenerator

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.class_for_name(name) ⇒ Object

Get the Class for the specified name.

For example, if name is :surrogate_key then a SurrogateKeyGenerator class is returned



9
10
11
# File 'lib/etl/generator/generator.rb', line 9

def class_for_name(name)
  ETL::Generator.const_get("#{name.to_s.camelize}Generator")
end

Instance Method Details

#nextObject

Generate the next value. This method must be implemented by subclasses



15
16
17
# File 'lib/etl/generator/generator.rb', line 15

def next
  raise "Must be implemented by a subclass"
end