Class: Yapra::LegacyPlugin::Base
- Inherits:
-
Object
- Object
- Yapra::LegacyPlugin::Base
- Defined in:
- lib/yapra/legacy_plugin/base.rb
Instance Attribute Summary collapse
-
#_yapra_pipeline ⇒ Object
readonly
Returns the value of attribute _yapra_pipeline.
-
#_yapra_run_method ⇒ Object
readonly
Returns the value of attribute _yapra_run_method.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
- #_yapra_run_as_legacy_plugin(config, data) ⇒ Object
- #eval_pragger(command_array, data) ⇒ Object
-
#initialize(pipeline, plugin_path) ⇒ Base
constructor
A new instance of Base.
- #logger ⇒ Object
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.to_s, 1) end |
Instance Attribute Details
#_yapra_pipeline ⇒ Object (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_method ⇒ Object (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 |
#source ⇒ Object (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 |