I have written a code as below :

module A
  module B
    class B2
      class B1Error < Exception ;end
      class B2_inner
        $a = Module.constants
      end
    end
  end
end

$a - Module.constants
# => [:B1Error, :B2_inner, :B2, :B]

But now I want only the class names.. How to do so? means I want only
the below:

[:B1Error, :B2_inner, :B2]

-- 
Posted via http://www.ruby-forum.com/.