Module: HaveAPI::Hookable::ClassMethods

Defined in:
lib/haveapi/hooks.rb

Instance Method Summary collapse

Instance Method Details

#call_hooksObject

Call all hooks for ‘name`. see HaveAPI::Hooks.call_for.



208
209
210
# File 'lib/haveapi/hooks.rb', line 208

def call_hooks(*, **)
  Hooks.call_for(to_s, *, **)
end

#connect_hook(name) ⇒ Object

Connect ‘block` to registered hook with `name`.



203
204
205
# File 'lib/haveapi/hooks.rb', line 203

def connect_hook(name, &)
  Hooks.connect_hook(to_s, name, &)
end

#has_hook(name, opts = {}) ⇒ Object

Register a hook named ‘name`.



198
199
200
# File 'lib/haveapi/hooks.rb', line 198

def has_hook(name, opts = {})
  Hooks.register_hook(to_s, name, opts)
end