method

constants

v1_9_2_180 - Show latest stable - Class: Module
constants(*args)
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"]