Class: Yapra::LegacyPlugin::RegistryFactory
- Inherits:
-
Object
- Object
- Yapra::LegacyPlugin::RegistryFactory
- Defined in:
- lib/yapra/legacy_plugin/registry_factory.rb
Overview
RegistryFactory is factory class for LegacyPluginRegistry.
LegacyPluginRegistry is created by mode.
If mode is compatible, this factory create a CompatibeModeRegistry.
Instance Attribute Summary collapse
-
#plugin_paths ⇒ Object
readonly
Returns the value of attribute plugin_paths.
-
#registry_class ⇒ Object
readonly
Returns the value of attribute registry_class.
Instance Method Summary collapse
- #create(pipeline) ⇒ Object
-
#initialize(plugin_paths, mode = 'compatible') ⇒ RegistryFactory
constructor
- plugin_paths
-
directory paths which are contains legacy plugins.
Constructor Details
#initialize(plugin_paths, mode = 'compatible') ⇒ RegistryFactory
- plugin_paths
-
directory paths which are contains legacy plugins.
- mode
-
‘compatible’ / ‘advance’
15 16 17 18 19 20 21 |
# File 'lib/yapra/legacy_plugin/registry_factory.rb', line 15 def initialize plugin_paths, mode = 'compatible' registry_name = "Yapra::LegacyPlugin::#{Yapra::Inflector.camelize(mode)}ModeRegistry" @registry_class = Yapra.load_class_constant(registry_name) raise "'#{mode}' mode is not supported." unless @registry_class @plugin_paths = plugin_paths end |
Instance Attribute Details
#plugin_paths ⇒ Object (readonly)
Returns the value of attribute plugin_paths.
10 11 12 |
# File 'lib/yapra/legacy_plugin/registry_factory.rb', line 10 def plugin_paths @plugin_paths end |
#registry_class ⇒ Object (readonly)
Returns the value of attribute registry_class.
11 12 13 |
# File 'lib/yapra/legacy_plugin/registry_factory.rb', line 11 def registry_class @registry_class end |
Instance Method Details
#create(pipeline) ⇒ Object
23 24 25 26 27 |
# File 'lib/yapra/legacy_plugin/registry_factory.rb', line 23 def create pipeline registry = registry_class.new(plugin_paths, pipeline) pipeline.legacy_plugin_registry = registry registry end |