Module: DhEasy::Core::Plugin::InitializeHook

Included in:
Config, Executor, Finisher, Parser, Seeder
Defined in:
lib/dh_easy/core/plugin/initialize_hook.rb

Instance Method Summary collapse

Instance Method Details

#initialize_hooks(opts = {}) ⇒ Object

Execute all methods with ‘initilaize_hook_` prefix (hooks).

Parameters:

  • opts (Hash) (defaults to: {})

    ({}) Configuration options sent to all hooks.



8
9
10
11
12
13
# File 'lib/dh_easy/core/plugin/initialize_hook.rb', line 8

def initialize_hooks opts = {}
  initializers = self.methods.select{|i|i.to_s =~ /^initialize_hook_/}
  initializers.each do |method|
    self.send method, opts
  end
end