From: Ara.T.Howard@... Date: 2004-09-02T02:45:23+09:00 Subject: Re: accessing superclass variables On Wed, 1 Sep 2004, Nicolaj Soendberg Madsen wrote: > How do I access an outer variable from within a nested class? > > Is it possible to directly access them? jib:~ > cat a.rb class Outer CONST = 42 p CONST class Inner CONST = 42.0 p CONST p Outer::CONST p ::Outer::CONST end p Inner::CONST end p Outer::CONST p Outer::Inner::CONST p ::Outer::CONST p ::Outer::Inner::CONST jib:~ > ruby a.rb 42 42.0 42 42 42.0 42 42.0 42 42.0 initial '::' means 'start at the very top level. not needed here - but good to know. cheers. -a -- =============================================================================== | EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov | PHONE :: 303.497.6469 | A flower falls, even though we love it; | and a weed grows, even though we do not love it. | --Dogen ===============================================================================