Module: TheHelp::ProvidesCallbacks
- Included in:
- Service
- Defined in:
- lib/the_help/provides_callbacks.rb
Overview
Adds a callback DSL to including classes
Callbacks can be given to collaborating objects, but the actual methods are defined as private methods. This allows the object to control which other objects are able to invoke the callbacks (at least to the extent that Ruby lets you do so.)
If the including class defines a #logger instance method, a debug-level message will be logged indicating that the callback was invoked.
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Class Method Details
.included(other) ⇒ Object
38 39 40 41 42 43 |
# File 'lib/the_help/provides_callbacks.rb', line 38 def self.included(other) other.class_eval do extend TheHelp::ProvidesCallbacks::ClassMethods alias_method :callback, :method end end |