Class: Embulk::ParserPlugin

Inherits:
Object
  • Object
show all
Defined in:
embulk-core/src/main/ruby/embulk/parser_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, page_builder) ⇒ ParserPlugin

Returns a new instance of ParserPlugin



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

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

Instance Attribute Details

#page_builderObject (readonly)

Returns the value of attribute page_builder



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

def page_builder
  @page_builder
end

#schemaObject (readonly)

Returns the value of attribute schema



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

def schema
  @schema
end

#taskObject (readonly)

Returns the value of attribute task



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

def task
  @task
end

Class Method Details

.from_java(java_class) ⇒ Object



65
66
67
# File 'embulk-core/src/main/ruby/embulk/parser_plugin.rb', line 65

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

.new_javaObject



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

def self.new_java
  JavaAdapter.new(self)
end

.transaction(config, &control) ⇒ Object

Raises:

  • (NotImplementedError)


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

def self.transaction(config, &control)
  raise NotImplementedError, "ParserPlugin.transaction(config, &control) must be implemented"
end

Instance Method Details

#initObject



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

def init
end

#run(file_input) ⇒ Object

Raises:

  • (NotImplementedError)


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

def run(file_input)
  raise NotImplementedError, "ParserPlugin#run(file_input) must be implemented"
end