From: David Douthitt Date: 2000-03-16T16:24:25-06:00 Subject: [ruby-talk:01932] Re: Class Variables | "David Douthitt" writes: | | > I DID find class constants (see I do read the manual! :-) | > | > But I ALSO want to be able to do: | > | > fooey.setting1 = 6; | | Ah-ha! In that case, you want to use attributes | | class Foo | | attr_accessor :setting1, :setting2 | | def initialize | @setting1 = 2 | @setting2 = 5 | end | end | | c = Foo.new | | p c.setting1 + c.setting2 | | c.setting2 = 7 | | p c.setting1 + c.setting2 Doesn't that work only in modules? I can't find 'attr_accessor' and others anywhere except in the Module class. ...dave