Module: PolyDelegate::Delegated

Defined in:
lib/poly_delegate/delegated.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Class Method Details

.included(base)



13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/poly_delegate/delegated.rb', line 13

def self.included(base)
  base.extend(ClassMethods)

  base.class_eval do
    intercepted = [base, Object, Kernel, BasicObject]
    intercepted = intercepted.map(&:instance_methods).reduce(&:-)

    intercepted.each do |name|
      PolyDelegate.create_delegated_method(base, name)
    end
  end
end