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

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

Instance Method Summary collapse

Constructor Details

#initialize(factory, components) ⇒ Factory

Returns a new instance of Factory.



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

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

Instance Method Details

#newObject



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

def new
  @components.each(&:rotate)

  url = @components.inject(@factory.url) do |u, f|
    u.merge("#{u.path}.#{f.extension}")
  end

  Hydrogen::TableObject.new(@factory.model, url)
end

#writerObject



22
23
24
# File 'lib/schlepp/sink/table_object/factory.rb', line 22

def writer
  Writer::Factory.new(@factory, @components, self.new).new
end