Module: HaveAPI::Hookable::ClassMethods

Defined in:
lib/haveapi/hooks.rb

Instance Method Summary collapse

Instance Method Details

#call_hooks(*args) ⇒ Object

Call all hooks for name. see Hooks.call_for.



135
136
137
# File 'lib/haveapi/hooks.rb', line 135

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

#connect_hook(name, &block) ⇒ Object

Connect block to registered hook with name.



130
131
132
# File 'lib/haveapi/hooks.rb', line 130

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

#has_hook(name) ⇒ Object

Register a hook named name.



125
126
127
# File 'lib/haveapi/hooks.rb', line 125

def has_hook(name)
  Hooks.register_hook(self.to_s, name)
end