From: "Jesús Gabriel y Galán" Date: 2010-07-28T17:55:32+09:00 Subject: Re: syntax On Tue, Jul 27, 2010 at 7:37 PM, Raghu Maddali wrote: > I've conf and database as class variables which I access in some other > methods too...So can I write it as > > class Web >      @@config >      @@database You don't need to declare the variables. >   def initialize >     @@config = parse_ini_file('web/display.ini', true) >     @@database = @@config['Catalog']['database'] >   end >    def methodA() >     @@database=...... >    end >  end If they are class variables, it usually doesn't make a lot of sense to initialize them every time you create an instance of this class. Maybe the initialization of those variables should be put outside the initialize method, or if the values they might have could be different on each instance of the class, then leave them as instance variables. Jesus.