Created
May 19, 2017 04:45
-
-
Save MatthiasWinkelmann/f7bcd0ff022bce26119f23be69aa499a to your computer and use it in GitHub Desktop.
Filter ruby's <Class>.methods to exclude the common ones
This file contains 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
module ObjectExtensions | |
def methods | |
return super - Object.methods unless self == Object | |
super | |
end | |
end | |
class Object | |
prepend ObjectExtensions | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You're trying to find a method in some gem's class. Or whatever. Usually, it has 200 methods, most of which are generic and probably not what you're looking for if you have any experience with ruby.
Better:
Before