Module: Plate::Callbacks::ClassMethods
- Defined in:
- lib/plate/callbacks.rb
Instance Method Summary collapse
-
#callbacks ⇒ Object
All of the callbacks that have been registered.
-
#register_callback(name, method_name = nil, &block) ⇒ Object
Register a new callback.
Instance Method Details
#callbacks ⇒ Object
All of the callbacks that have been registered.
19 20 21 |
# File 'lib/plate/callbacks.rb', line 19 def callbacks @callbacks ||= {} end |
#register_callback(name, method_name = nil, &block) ⇒ Object
Register a new callback
29 30 31 32 |
# File 'lib/plate/callbacks.rb', line 29 def register_callback(name, method_name = nil, &block) callbacks[name] ||= [] callbacks[name] << (block || method_name) end |