Last active
December 16, 2015 20:59
-
-
Save jwaldrip/5496223 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BasicObject | |
def self.local_methods | |
return methods unless superclass | |
methods - superclass.methods | |
end | |
def self.local_method(sym) | |
method self.local_methods.find { |i| i == sym } | |
end | |
def self.local_instance_methods | |
return instance_methods unless superclass | |
instance_methods - superclass.instance_methods | |
end | |
def self.local_instance_method(sym) | |
instance_method self.local_instance_methods.find { |i| i == sym } | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment