Class: Schlepp::Sink::TableObject::Filter::Writer
- Inherits:
-
Object
- Object
- Schlepp::Sink::TableObject::Filter::Writer
- Defined in:
- lib/schlepp/sink/table_object/filter/writer.rb
Instance Method Summary collapse
- #finalize ⇒ Object
-
#initialize(writer, observer, opts = {}) ⇒ Writer
constructor
A new instance of Writer.
- #write(rows) ⇒ Object
Constructor Details
#initialize(writer, observer, opts = {}) ⇒ Writer
Returns a new instance of Writer.
6 7 8 9 |
# File 'lib/schlepp/sink/table_object/filter/writer.rb', line 6 def initialize(writer, observer, opts = {}) @writer = writer @observer = observer end |
Instance Method Details
#finalize ⇒ Object
18 19 20 21 |
# File 'lib/schlepp/sink/table_object/filter/writer.rb', line 18 def finalize @writer.finalize @observer.reset end |
#write(rows) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/schlepp/sink/table_object/filter/writer.rb', line 11 def write(rows) Array(rows).each do |row| @writer.write(row) @observer.add(row) end end |