Class: Embulk::FormatterPlugin::JavaAdapter::OutputAdapter
- Inherits:
-
Object
- Object
- Embulk::FormatterPlugin::JavaAdapter::OutputAdapter
- Includes:
- Java::TransactionalPageOutput
- Defined in:
- lib/embulk/formatter_plugin.rb
Instance Method Summary collapse
- #add(java_page) ⇒ Object
- #close ⇒ Object
- #finish ⇒ Object
-
#initialize(ruby_object, schema, file_output) ⇒ OutputAdapter
constructor
A new instance of OutputAdapter.
Constructor Details
#initialize(ruby_object, schema, file_output) ⇒ OutputAdapter
Returns a new instance of OutputAdapter.
69 70 71 72 73 |
# File 'lib/embulk/formatter_plugin.rb', line 69 def initialize(ruby_object, schema, file_output) @ruby_object = ruby_object @schema = schema @file_output = file_output end |
Instance Method Details
#add(java_page) ⇒ Object
75 76 77 78 |
# File 'lib/embulk/formatter_plugin.rb', line 75 def add(java_page) # TODO reuse page reader @ruby_object.add Page.new(java_page, @schema) end |
#close ⇒ Object
84 85 86 87 88 |
# File 'lib/embulk/formatter_plugin.rb', line 84 def close @ruby_object.close ensure @file_output.close end |
#finish ⇒ Object
80 81 82 |
# File 'lib/embulk/formatter_plugin.rb', line 80 def finish @ruby_object.finish end |