You can get a list of all the constants defined in the module using Module#constants . Example:
Object.constants.sort # => [:ARGF, :ARGV, :ArgumentError, :Array, :BasicObject, :Bignum, ... ]
For methods, you can call one of the various Module#methods :
Object.methods.sort # => [:!, :!=, :!~, :<, :<=, :<=>, :==, :===, :=~, :>, :>=, :__id__, ... ]
You can get a list of all the various methods methods using reflection itself (yay meta):
Module.methods.sort.grep /methods/
It is not possible to get a list of instance variables from a module for the simple reason that the modules are not aware of instance variables, because unlike Smalltalk or Java, instance variables are not fixed by the class, they are simply dynamically added to the object as needed.
source share