Class: Schlepp::Sink::TableObject::Writer::Factory

Inherits:
Object
  • Object
show all
Defined in:
lib/schlepp/sink/table_object/writer/factory.rb

Instance Method Summary collapse

Constructor Details

#initialize(factory, components, table_object) ⇒ Factory

Returns a new instance of Factory.



6
7
8
9
10
# File 'lib/schlepp/sink/table_object/writer/factory.rb', line 6

def initialize(factory, components, table_object)
  @factory = factory
  @components = components
  @table_object = table_object
end

Instance Method Details

#newObject



12
13
14
15
16
17
# File 'lib/schlepp/sink/table_object/writer/factory.rb', line 12

def new
  writer = @factory.writer(@table_object)
  @components.reverse.inject(writer) {|base, f|
    f.writer.new(base)
  }
end