Class: Schlepp::Sink::TableObject::Carosel
- Inherits:
-
Object
- Object
- Schlepp::Sink::TableObject::Carosel
- Defined in:
- lib/schlepp/sink/table_object/carosel.rb
Instance Method Summary collapse
- #finalize ⇒ Object
-
#initialize(factory, chain) ⇒ Carosel
constructor
A new instance of Carosel.
- #write(data) ⇒ Object
Constructor Details
#initialize(factory, chain) ⇒ Carosel
Returns a new instance of Carosel.
8 9 10 11 12 13 14 |
# File 'lib/schlepp/sink/table_object/carosel.rb', line 8 def initialize(factory, chain) @factory = factory @chain = chain @parts = [] @current = rotate @finalized = false end |
Instance Method Details
#finalize ⇒ Object
29 30 31 32 33 |
# File 'lib/schlepp/sink/table_object/carosel.rb', line 29 def finalize @current.finalize @finalized = true @parts end |
#write(data) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/schlepp/sink/table_object/carosel.rb', line 16 def write(data) raise_if_finalized if rotate?(data) rotate if rotate?(data) raise end end Array(data).each do |r| @current.write(r) end end |