Skip to content

Instantly share code, notes, and snippets.

@rjungemann
Created October 3, 2009 07:34
Show Gist options
  • Save rjungemann/200465 to your computer and use it in GitHub Desktop.
Save rjungemann/200465 to your computer and use it in GitHub Desktop.
The Object#grok method, for exploring Ruby objects
# the grok method - shows a list of "interesting" methods for an object
# usage - "hello".grok
# => ["%", "*", "+", "<<", "[]", "[]=", "all?", "any?", ...]
class Object
def grok
(self.methods - Object.new.methods).sort
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment