Class: Embulk::FormatterPlugin

Inherits:
Object
  • Object
show all
Defined in:
embulk-core/src/main/ruby/embulk/formatter_plugin.rb

Defined Under Namespace

Modules: RubyAdapter Classes: JavaAdapter

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(task, schema, file_output) ⇒ FormatterPlugin

Returns a new instance of FormatterPlugin



14
15
16
17
18
19
# File 'embulk-core/src/main/ruby/embulk/formatter_plugin.rb', line 14

def initialize(task, schema, file_output)
  @task = task
  @schema = schema
  @file_output = file_output
  init
end

Instance Attribute Details

#file_outputObject (readonly)

Returns the value of attribute file_output



21
22
23
# File 'embulk-core/src/main/ruby/embulk/formatter_plugin.rb', line 21

def file_output
  @file_output
end

#schemaObject (readonly)

Returns the value of attribute schema



21
22
23
# File 'embulk-core/src/main/ruby/embulk/formatter_plugin.rb', line 21

def schema
  @schema
end

#taskObject (readonly)

Returns the value of attribute task



21
22
23
# File 'embulk-core/src/main/ruby/embulk/formatter_plugin.rb', line 21

def task
  @task
end

Class Method Details

.from_java(java_class) ⇒ Object



91
92
93
# File 'embulk-core/src/main/ruby/embulk/formatter_plugin.rb', line 91

def self.from_java(java_class)
  JavaPlugin.ruby_adapter_class(java_class, FormatterPlugin, RubyAdapter)
end

.new_javaObject



36
37
38
# File 'embulk-core/src/main/ruby/embulk/formatter_plugin.rb', line 36

def self.new_java
  JavaAdapter.new(self)
end

.transaction(config, schema) {|config| ... } ⇒ Object

Yields:

  • (config)


9
10
11
12
# File 'embulk-core/src/main/ruby/embulk/formatter_plugin.rb', line 9

def self.transaction(config, schema, &control)
  yield(config)
  return {}
end

Instance Method Details

#add(page) ⇒ Object

Raises:

  • (NotImplementedError)


26
27
28
# File 'embulk-core/src/main/ruby/embulk/formatter_plugin.rb', line 26

def add(page)
  raise NotImplementedError, "FormatterPlugin#add(page) must be implemented"
end

#closeObject



33
34
# File 'embulk-core/src/main/ruby/embulk/formatter_plugin.rb', line 33

def close
end

#finishObject



30
31
# File 'embulk-core/src/main/ruby/embulk/formatter_plugin.rb', line 30

def finish
end

#initObject



23
24
# File 'embulk-core/src/main/ruby/embulk/formatter_plugin.rb', line 23

def init
end