Skip to content

Instantly share code, notes, and snippets.

@joeybeninghove
Created February 14, 2018 02:06
Show Gist options
  • Save joeybeninghove/94edc251d760ca4c3894ba670052a1a5 to your computer and use it in GitHub Desktop.
Save joeybeninghove/94edc251d760ca4c3894ba670052a1a5 to your computer and use it in GitHub Desktop.
Helper to show just the methods that matter for a Ruby object
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