From: Ryan Davis Date: 2010-12-04T06:59:37+09:00 Subject: Re: cast object to object On Dec 3, 2010, at 12:07 , Gary Wright wrote: > Object.const_get doesn't parse composite names like "FireWatir::Link". You would have to handle that in two steps: > > dave = Object.const_get('FireWatir').const_get('Link').new This is one of the very few legitimate uses of inject in popular use: klass = "FireWatir::Link".split(/::/).inject(Object) { |k, n| k.const_get n }