From: MonkeeSage Date: 2006-09-12T17:35:38+09:00 Subject: Re: Reflection and files Gavin Kistner wrote: > Well, here's one terrible idea. (It's 'terrible' because it's brittle, > and only works if no other files defining new classes have been defined, > and will break if a new Ruby release defines a new class.) How about: def get_class_from_file(file) consts = Object.constants require file return (Object.constants - consts)[0] end p get_class_from_file('/path/to/some_file.rb') Regards, Jordan