From: Marcus Bristav Date: 2006-08-30T23:21:56+09:00 Subject: Finding classes ------=_Part_18866_8692935.1156947692318 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline I need to find classes that either: 1) Includes a specific module or 2) Includes a specfic string in the class name Either of the two is fine. This is in a Rails environment where I want to find all classes using one of the two rules above. The problem is that the classes I want to find probably aren't "required" at the time of searching (ie ObjectSpace#each_object doesn't find them as far as I can tell and Module#included hasn't been triggered). Is it possible to do this? Best regards, Marcus Tried this (doesn't work): class_names = Array.new ObjectSpace.each_object { |obj| class_names << obj.name if obj.is_a?(Class) && obj.name.include?("ChannelBehaviour") } behaviours = classes.uniq.map { |name| Class.const_get(name) } ------=_Part_18866_8692935.1156947692318--