Module: Module::ChainMethod

Defined in:
lib/module/chain_method.rb

Defined Under Namespace

Modules: ModuleMethods

Class Method Summary collapse

Class Method Details

.included(target) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/module/chain_method.rb', line 4

def self.included target
  # $stderr.puts "ChainMethod #{self.inspect}.included #{target}"
  super
  if target.method_defined?(:included) && ! target.method_defined?(:included_without_ChainMethod)
    target.send(:alias_method, :included_without_ChainMethod, :included)
  end
  target.extend(ClassMethods)  if Class  === target 
  target.extend(ModuleMethods) if Module === target
end