Module: HaveAPI::Hookable::ClassMethods

Defined in:
lib/haveapi/hooks.rb

Instance Method Summary collapse

Instance Method Details

#call_hooks(*args, **kwargs) ⇒ Object

Call all hooks for name. see Hooks.call_for.



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

def call_hooks(*args, **kwargs)
  Hooks.call_for(self.to_s, *args, **kwargs)
end

#connect_hook(name, &block) ⇒ Object

Connect block to registered hook with name.



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

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

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

Register a hook named name.



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

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