On Apr 8, 10:01=A0pm, Tony Arcieri <t... / medioh.com> wrote:
> [Note: =A0parts of this message were removed to make it a legal post.]
>
> On Wed, Apr 8, 2009 at 2:40 PM, stephen O'D <stephen.odonn... / gmail.com>w=
rote:
>
> > dispatch =3D {
> > =A0'Foo' =3D> Foo,
> > =A0'Bar' =3D> Bar
> > }
>
> > obj =3D dispatch[var].new(...)
>
> > Is there another Ruby way to do this sort of thing?
>
> Object.const_get(var).new(...)
>
> or with ActiveSupport:
>
> var.constantize.new(...)
>
> --
> Tony Arcieri
> medioh.com

Thanks, works perfectly!