From: Heath Novak Date: 2007-12-15T00:31:50+09:00 Subject: Re: C extension: can rb_ivar_set be used to set class variable? unsubscribe On Dec 13, 2007, at 10:27 PM, Nobuyoshi Nakada wrote: > Hi, > > At Fri, 14 Dec 2007 14:20:01 +0900, > lianliming wrote in [ruby-talk:283492]: >> So I wonder if this is a way to set class variable for a class. I am >> really confused because the document says it should be used to set >> value of instance variable to a given obj. Am I missing some >> knowledge? > > No, use rb_cvar_set to set class variables. rb_ivar_set sets > an instance variable of a class instance. I.E., > > class Foo > @foo = "ivar" > @@foo = "cvar" > end > > -- > Nobu Nakada >