From: Ryan Davis Date: 2006-07-09T16:24:56+09:00 Subject: Re: attr_reader as a class method On Jul 9, 2006, at 12:17 AM, Minkoo Seo wrote: > I'd like to use attr_reader to introduce a class method. For example, > the following is the code I've tried. > > irb(main):001:0> class Foo > irb(main):002:1> ONE = 1 > irb(main):003:1> end The example is simply flawed. ONE is a constant and can be accessed from outside Foo as Foo.ONE without any extra code. attr_* don't provide access to constants, only instance variables (including the instance of a class).