Park Heesob
6/6/2006 6:24:00 AM
Hi,
<petermichaux@gmail.com> wrote in message
news:1149569152.804306.262190@j55g2000cwa.googlegroups.com...
> Hi,
>
> I've been programming JavaScript a lot lately and would like to find a
> way to create and object without defining a class like the JavaScript
> object literal. Is there a quick an dirty object in Ruby?
>
> In JavaScript
>
> var a = {foo: 34, bar:89}
> a.foo
> a.bar
>
>
a = Struct.new(:foo,:bar).new(34,89)
a.foo
a.bar
> Thanks,
> Peter
>
Regards,
Park Heesob