Class: Yapra::LegacyPlugin::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/yapra/legacy_plugin/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pipeline, plugin_path) ⇒ Base

Returns a new instance of Base.



10
11
12
13
14
# File 'lib/yapra/legacy_plugin/base.rb', line 10

def initialize(pipeline, plugin_path)
  @_yapra_pipeline     = pipeline
  @_yapra_run_method  = File.basename(plugin_path, '.*')
  instance_eval( @source = File.read(plugin_path).toutf8, plugin_path, 1)
end

Instance Attribute Details

#_yapra_pipelineObject (readonly)

Returns the value of attribute _yapra_pipeline.



8
9
10
# File 'lib/yapra/legacy_plugin/base.rb', line 8

def _yapra_pipeline
  @_yapra_pipeline
end

#_yapra_run_methodObject (readonly)

Returns the value of attribute _yapra_run_method.



7
8
9
# File 'lib/yapra/legacy_plugin/base.rb', line 7

def _yapra_run_method
  @_yapra_run_method
end

#sourceObject (readonly)

Returns the value of attribute source.



6
7
8
# File 'lib/yapra/legacy_plugin/base.rb', line 6

def source
  @source
end

Instance Method Details

#_yapra_run_as_legacy_plugin(config, data) ⇒ Object



24
25
26
# File 'lib/yapra/legacy_plugin/base.rb', line 24

def _yapra_run_as_legacy_plugin(config, data)
  self.__send__(self._yapra_run_method, config, data)
end

#eval_pragger(command_array, data) ⇒ Object



20
21
22
# File 'lib/yapra/legacy_plugin/base.rb', line 20

def eval_pragger(command_array, data)
  pipeline.execute_plugins(command_array, data)
end

#loggerObject



16
17
18
# File 'lib/yapra/legacy_plugin/base.rb', line 16

def logger
  Yapra::Runtime.logger
end