module ObjectSpace

def classes

Returns all the classes in the object space.
def classes
  ObjectSpace.each_object(Module).select do |klass|
    # Why? Ruby, when you remove a costant dosen't remove it from
    # rb_tables, this mean that here we can find classes that was
    # removed.
    klass.name rescue false
  end
end