From: Mait Date: 2006-10-11T07:20:17+09:00 Subject: Re: Newbie problem of Class attributes On Oct 11, 6:56 am, Morton Goldberg wrote: > On Oct 10, 2006, at 5:18 PM, Dipesh Batheja wrote: > > > I am trying to create a class level attribute which can read and > > write. > > I am doing something like this: > > > def self.selected_client > > -- my code -- > > end > > > def self.selected_client=(value) > > -- my code -- > > end > > > but its seems that the Ruby interpreter is not liking this. Can > > someone > > tell me how to create class level attributes that can read and write. > #! /usr/bin/env ruby -w > > class A > class << self > attr_accessor :foo > end > end > > A.foo = 'bar' > A.foo # => "bar" > > > Regards, Morton What means 'class << self' ? I don't understand... Plz anyone let me know secret ; ) Thanks.