Module: Garcon::Hookers::ClassMethods

Included in:
Garcon::Hookers
Defined in:
lib/garcon/utility/hookers.rb

Instance Method Summary collapse

Instance Method Details

#callbacks_for_hooker(name) ⇒ Object



42
43
44
# File 'lib/garcon/utility/hookers.rb', line 42

def callbacks_for_hooker(name)
  _hookers[name]
end

#define_hookers(*names) ⇒ Object Also known as: define_hooker



28
29
30
31
# File 'lib/garcon/utility/hookers.rb', line 28

def define_hookers(*names)
  options = extract_options!(names)
  names.each { |name| setup_hooker(name, options) }
end

#run_hooker(name, *args) ⇒ Object



34
35
36
# File 'lib/garcon/utility/hookers.rb', line 34

def run_hooker(name, *args)
  run_hooker_for(name, self, *args)
end

#run_hooker_for(name, scope, *args) ⇒ Object



38
39
40
# File 'lib/garcon/utility/hookers.rb', line 38

def run_hooker_for(name, scope, *args)
  _hookers[name].run(scope, *args)
end