>>>>> "C" == Christoph Rippel <crippel / primenet.com> writes:

C> The question is how get a handle on the meta class this is what
C>   MetaFred = ObjectSpace._id2ref (
C> class << Fred
C> id
C> end )
C> does.   Now I can define MetaFred method  which has access to this variable

C> def MetaFred.var
C>      @var
C> end

C> that is

C> p MetaFred.var          #  => 234

 I'm probably stupid but why you don't write ?

   class Fred
      @var = 234
   end

   def Fred.var
      @var
   end

   p Fred.var


 variable with the prefix '@@' was introduced because it's was not possible
to access a class variable in a method, i.e.

   class Fred
      def toto
         @var # this is always an instance variable
      end
   end


Guy Decoux