From: Navya Amerineni Date: 2006-04-11T07:21:54+09:00 Subject: Identfying classes in a file dynamically --0-122354698-1144707710=:84458 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Hi, I was trying to identify the classes in a give file at the run time. the following is the code i used. sc, ec = [], [] ObjectSpace.each_object(Class) { |c| sc << c } require 'Roman.rb' ObjectSpace.each_object(Class) { |c| ec << c } new_classes = ec - sc puts new_classes sc, ec = [], [] ObjectSpace.each_object(Class) { |c| sc << c } require 'Roman1.rb' ObjectSpace.each_object(Class) { |c| ec << c } new_classes = ec - sc puts new_classes Both roman.rb and roman1.rb has the same class Roman. the first time i print the new_classes i can see the Roman class in the output but the second one does not print because the class Roman is arleady read previously. is there a way i can over come this problem and identify the Roman class twice. Thanks, Navya. --------------------------------- New Yahoo! Messenger with Voice. Call regular phones from your PC and save big. --0-122354698-1144707710=:84458--