Module: Extlib::Hook

### Home Classes Methods

### In Files

- lib/extlib/hook.rb

### Namespace

- MODULE Extlib::Hook::ClassMethods

### Methods

- ::included
- ::method_added
- ::singleton_method_added

### Files

- LICENSE
- README.rdoc

### Class/Module Index

Quicksearch

- Extlib
- Extlib::Assertions
- Extlib::ByteArray
- Extlib::Hook
- Extlib::Hook::ClassMethods
- Extlib::Inflection
- Extlib::LocalObjectSpace
- Extlib::Logger
- Extlib::Pooling
- Extlib::Pooling::InvalidResourceError
- Extlib::Pooling::Pool
- Extlib::SimpleSet
- Gem
- Gem::SourceIndex
- Gem::Specification
- LazyModule
- LazyModule::ClassMethods
- Array
- Class
- DateTime
- Dictionary
- FalseClass
- Hash
- LazyArray
- Mash
- Module
- NilClass
- Numeric
- Object
- ObjectSpace
- Pathname
- REXMLUtilityNode
- String
- Struct
- Symbol
- Time
- ToHashParser
- TrueClass
- VirtualFile

No matching classes.

# Extlib::Hook

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

### Public Class Methods

included(base) click to toggle source

    # File lib/extlib/hook.rb, line 30
    def self.included(base)
      base.extend(ClassMethods)
      base.const_set("CLASS_HOOKS", {}) unless base.const_defined?("CLASS_HOOKS")
      base.const_set("INSTANCE_HOOKS", {}) unless base.const_defined?("INSTANCE_HOOKS")
      base.class_eval do
        class << self
          def method_added(name)
            process_method_added(name, :instance)
            super
          end

          def singleton_method_added(name)
            process_method_added(name, :class)
            super
          end
        end
      end
    end

method_added(name) click to toggle source

    # File lib/extlib/hook.rb, line 36
    def method_added(name)
      process_method_added(name, :instance)
      super
    end

singleton_method_added(name) click to toggle source

    # File lib/extlib/hook.rb, line 41
    def singleton_method_added(name)
      process_method_added(name, :class)
      super
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.