Class: Kettle::Jem::PluginRegistrar

Inherits:
Object
  • Object
show all
Defined in:
lib/kettle/jem.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(plugin_name:, registry:) ⇒ PluginRegistrar

Returns a new instance of PluginRegistrar.



1676
1677
1678
1679
# File 'lib/kettle/jem.rb', line 1676

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.



1674
1675
1676
# File 'lib/kettle/jem.rb', line 1674

def plugin_name
  @plugin_name
end

Instance Method Details

#after_phase(phase, &block) ⇒ Object



1689
1690
1691
# File 'lib/kettle/jem.rb', line 1689

def after_phase(phase, &block)
  on_phase(phase, timing: :after, &block)
end

#before_phase(phase, &block) ⇒ Object



1685
1686
1687
# File 'lib/kettle/jem.rb', line 1685

def before_phase(phase, &block)
  on_phase(phase, timing: :before, &block)
end

#on_phase(phase, timing: :after, &block) ⇒ Object



1681
1682
1683
# File 'lib/kettle/jem.rb', line 1681

def on_phase(phase, timing: :after, &block)
  @registry.register(plugin_name: plugin_name, phase: phase, timing: timing, &block)
end