Why does this not work?

>> class Foo
>>   self.class.attr_accessor :baz
>>   end
TypeError: Foo is not a class
        from (irb):19


I understand that the class << self idiom can be used to work around
this problem but I would like to understand why the above triggers such
an error and what is meant by it.

Thanks.
-- 
Posted via http://www.ruby-forum.com/.