Ruby equivalent of Python's "dir"?

HelpMe picture HelpMe · Jan 22, 2009 · Viewed 12k times · Source

In Python we can "dir" a module, like this:

>>> import re
>>> dir(re)

And it lists all functions in the module. Is there a similar way to do this in Ruby?

Answer

Jonas Elfström picture Jonas Elfström · Jan 22, 2009

As far as I know not exactly but you get somewhere with

object.methods.sort