Created
February 14, 2018 02:06
-
-
Save joeybeninghove/94edc251d760ca4c3894ba670052a1a5 to your computer and use it in GitHub Desktop.
Helper to show just the methods that matter for a Ruby object
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 Object | |
def interesting_methods | |
case self.class | |
when Class | |
self.public_methods.sort - Object.public_methods | |
when Module | |
self.public_methods.sort - Module.public_methods | |
else | |
self.public_methods.sort - Object.new.public_methods | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment