Class: BasicObject

Defined in:
lib/backports/basic_object.rb

Direct Known Subclasses

Object

Constant Summary collapse

KEEP =
[:instance_eval, :instance_exec, :__send__,
"instance_eval", "instance_exec", "__send__"]

Class Method Summary collapse

Class Method Details

.===(cmp) ⇒ Object



32
33
34
# File 'lib/backports/basic_object.rb', line 32

def === (cmp)
  true
end

.inherited(sub) ⇒ Object



42
43
44
45
46
47
48
49
50
# File 'lib/backports/basic_object.rb', line 42

def inherited(sub)
  BasicObject.class_eval do
    (instance_methods - KEEP).each do |method|
      if Object.method_defined?(method) && instance_method(method).owner == Object.instance_method(method).owner
        undef_method method
      end
    end
  end
end