Class: Kettle::Jem::PluginRegistrar
- Inherits:
-
Object
- Object
- Kettle::Jem::PluginRegistrar
- Defined in:
- lib/kettle/jem.rb
Instance Attribute Summary collapse
-
#plugin_name ⇒ Object
readonly
Returns the value of attribute plugin_name.
Instance Method Summary collapse
- #after_phase(phase, &block) ⇒ Object
- #before_phase(phase, &block) ⇒ Object
-
#initialize(plugin_name:, registry:) ⇒ PluginRegistrar
constructor
A new instance of PluginRegistrar.
- #on_phase(phase, timing: :after, &block) ⇒ Object
Constructor Details
#initialize(plugin_name:, registry:) ⇒ PluginRegistrar
Returns a new instance of PluginRegistrar.
1656 1657 1658 1659 |
# File 'lib/kettle/jem.rb', line 1656 def initialize(plugin_name:, registry:) @plugin_name = plugin_name.to_s @registry = registry end |
Instance Attribute Details
#plugin_name ⇒ Object (readonly)
Returns the value of attribute plugin_name.
1654 1655 1656 |
# File 'lib/kettle/jem.rb', line 1654 def plugin_name @plugin_name end |
Instance Method Details
#after_phase(phase, &block) ⇒ Object
1669 1670 1671 |
# File 'lib/kettle/jem.rb', line 1669 def after_phase(phase, &block) on_phase(phase, timing: :after, &block) end |
#before_phase(phase, &block) ⇒ Object
1665 1666 1667 |
# File 'lib/kettle/jem.rb', line 1665 def before_phase(phase, &block) on_phase(phase, timing: :before, &block) end |
#on_phase(phase, timing: :after, &block) ⇒ Object
1661 1662 1663 |
# File 'lib/kettle/jem.rb', line 1661 def on_phase(phase, timing: :after, &block) @registry.register(plugin_name: plugin_name, phase: phase, timing: timing, &block) end |