Module: HaveAPI::Hookable::ClassMethods
- Defined in:
- lib/haveapi/hooks.rb
Instance Method Summary collapse
-
#call_hooks(*args) ⇒ Object
Call all hooks for
name
. -
#connect_hook(name, &block) ⇒ Object
Connect
block
to registered hook withname
. -
#has_hook(name, opts = {}) ⇒ Object
Register a hook named
name
.
Instance Method Details
#call_hooks(*args) ⇒ Object
Call all hooks for name
. see Hooks.call_for.
204 205 206 |
# File 'lib/haveapi/hooks.rb', line 204 def call_hooks(*args) Hooks.call_for(self.to_s, *args) end |
#connect_hook(name, &block) ⇒ Object
Connect block
to registered hook with name
.
199 200 201 |
# File 'lib/haveapi/hooks.rb', line 199 def connect_hook(name, &block) Hooks.connect_hook(self.to_s, name, &block) end |
#has_hook(name, opts = {}) ⇒ Object
Register a hook named name
.
194 195 196 |
# File 'lib/haveapi/hooks.rb', line 194 def has_hook(name, opts = {}) Hooks.register_hook(self.to_s, name, opts) end |