Module: Garcon::Hookers::ClassMethods
- Included in:
- Garcon::Hookers
- Defined in:
- lib/garcon/utility/hookers.rb
Instance Method Summary collapse
- #callbacks_for_hooker(name) ⇒ Object
- #define_hookers(*names) ⇒ Object (also: #define_hooker)
- #run_hooker(name, *args) ⇒ Object
- #run_hooker_for(name, scope, *args) ⇒ Object
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) = (names) names.each { |name| setup_hooker(name, ) } 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 |