From: Dave Burt Date: 2005-10-15T17:46:55+09:00 Subject: Re: Factory function like Array() for your own classes Trans: > > Yep. Yep. Yep. I've sugegsted it before. But some people don't like it, > insisting that the ".new" gives some sort of additional clarity. Don't > know, but like your (our) way better --even wish it were built-in. Like this? def method_missing(sym, *args, &block) const = Object.const_get(sym) rescue nil if const.kind_of?(Module) const.new(*args, &block) else raise NoMethodError("undefined method '#{sym}' for #{self.inspect}") # OK, it is cool. end end Cheers, Dave