Module Extlib::Hook
In: lib/extlib/hook.rb
::String ByteArray Hash SimpleSet StandardError InvalidResourceError Logger Pool lib/extlib/logger.rb lib/extlib/simple_set.rb lib/extlib/byte_array.rb ClassMethods Hook Assertions lib/extlib/pooling.rb Pooling Inflection Extlib dot/m_31_0.png

TODO: Write more documentation!

Overview

==

The Hook module is a very simple set of AOP helpers. Basically, it allows the developer to specify a method or block that should run before or after another method.

Usage

Halting The Hook Stack

Inheritance

Other Goodies

Please bring up any issues regarding Hooks with carllerche on IRC

Methods

Classes and Modules

Module Extlib::Hook::ClassMethods

Public Class methods

[Source]

    # File lib/extlib/hook.rb, line 25
25:     def self.included(base)
26:       base.extend(ClassMethods)
27:       base.const_set("CLASS_HOOKS", {}) unless base.const_defined?("CLASS_HOOKS")
28:       base.const_set("INSTANCE_HOOKS", {}) unless base.const_defined?("INSTANCE_HOOKS")
29:       base.class_eval do
30:         class << self
31:           def method_added(name)
32:             process_method_added(name, :instance)
33:           end
34: 
35:           def singleton_method_added(name)
36:             process_method_added(name, :class)
37:           end
38:         end
39:       end
40:     end

[Source]

    # File lib/extlib/hook.rb, line 31
31:           def method_added(name)
32:             process_method_added(name, :instance)
33:           end

[Source]

    # File lib/extlib/hook.rb, line 35
35:           def singleton_method_added(name)
36:             process_method_added(name, :class)
37:           end

[Validate]