Class BasicObject
In: lib/backports/basic_object.rb
Parent: Object

Methods

===   inherited  

Constants

KEEP = %w[== equal? ! != instance_eval instance_exec __send__]

Public Class methods

[Source]

    # File lib/backports/basic_object.rb, line 33
33:     def === (cmp)
34:       true
35:     end

Let‘s try to keep things clean, in case methods have been added to Object either directly or through an included module. We‘ll do this whenever a class is derived from BasicObject Ideally, we‘d do this by trapping Object.method_added and M.method_added for any module M included in Object or a submodule Seems really though to get right, but pull requests welcome ;-)

[Source]

    # File lib/backports/basic_object.rb, line 43
43:     def inherited(sub)
44:       BasicObject.class_eval do
45:         (instance_methods - KEEP).each do |method|
46:           if Object.method_defined?(method) && instance_method(method).owner == Object.instance_method(method).owner
47:             undef_method method
48:           end
49:         end
50:       end
51:     end

[Validate]