method

constants

v1_8_7_330 - Show latest stable - Class: Module
constants()
public

Returns an array of the names of all constants defined in the system. This list includes the names of all modules and classes.

p Module.constants.sort[1..5]

produces:

["ARGV", "ArgumentError", "Array", "Bignum", "Binding"]