------ art_11276_9507844.1166738323093
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Seems it works perfectly fine when evaluating the string instead of block:
class A
@@avar hello"
end
A.class_eval("puts @@avar") # hello
A.class_eval { puts @@avar } # throws NameError
Very interestsing, anyone could explain it?
On 12/21/06, dblack / wobblini.net <dblack / wobblini.net> wrote:
>
> Hi --
>
> On Fri, 22 Dec 2006, gwtmp01 / mac.com wrote:
>
> > I generally avoid class variables but at the last meeting of the New
> Haven
> > Ruby Brigade a simple question about them led to a long discussion and
> irb
> > session that only served to confuse us all more.
> >
> > I'm hoping someone on the list can shed some light on a couple of issues
> that
> > were raised:
> >
> >>> class A
> >>> @@avar hello'
> >>> end
> >