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.
68 69 70 71 72 |
# File 'lib/embulk/formatter_plugin.rb', line 68 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
74 75 76 77 |
# File 'lib/embulk/formatter_plugin.rb', line 74 def add(java_page) # TODO reuse page reader @ruby_object.add Page.new(java_page, @schema) end |
#close ⇒ Object
83 84 85 86 87 |
# File 'lib/embulk/formatter_plugin.rb', line 83 def close @ruby_object.close ensure @file_output.close end |
#finish ⇒ Object
79 80 81 |
# File 'lib/embulk/formatter_plugin.rb', line 79 def finish @ruby_object.finish end |