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.



1580
1581
1582
1583
# File 'lib/kettle/jem.rb', line 1580

def initialize(plugin_name:, registry:)
  @plugin_name = plugin_name.to_s
  @registry = registry
end

Instance Attribute Details

#plugin_nameObject (readonly)

Returns the value of attribute plugin_name.



1578
1579
1580
# File 'lib/kettle/jem.rb', line 1578

def plugin_name
  @plugin_name
end

Instance Method Details

#after_phase(phase, &block) ⇒ Object



1593
1594
1595
# File 'lib/kettle/jem.rb', line 1593

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

#before_phase(phase, &block) ⇒ Object



1589
1590
1591
# File 'lib/kettle/jem.rb', line 1589

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

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



1585
1586
1587
# File 'lib/kettle/jem.rb', line 1585

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