[Nitro] Problem with OpenObject

TRANS transfire at gmail.com
Tue Jun 27 22:18:19 EDT 2006

On 6/27/06, George Moschovitis <george.moschovitis at gmail.com> wrote:
> Tom,
> there is a nasty problem with OpenObject. If you try to use eval
> inside an object that extends OpenObject you are in for nasty problems
> :( Switching to OpenStruct solves this. Saddly i dont have the time to
> look into the OpenObject implementation, but I wanted to report this.

Yea. That's an easy one. There are no methods in OpenObject! (Of
course there are some essential and non-clashing methods, but the
theory there are none.) Why are  your extending OpenObject anyway?
That's seems dangerous in and of itself. I actually need to see an
example to know exactly what you mean but there may be a work around
by running calls through the "self" role. This is still a kind of new,
so naming is still going through ironing out, but right now your can

 o = OpenObject.new
 o.__self__.instance_eval { ... }


More information about the Nitro-general mailing list