Gavin Kistner wrote:

> The reason .class doesn't return the eigenclass has nothing to do with
> it being 'hard' to represent.

Who said anything about it being 'hard'?

> On Feb 14, 5:08 pm, 7stud -- <bbxx789_0... / yahoo.com> wrote:
>> According to pickaxe2, that is correct.  However, the anonymous class is
>> called an 'anonymous' for a reason: it has no name.  So, what would
>> obj.class return if that were to retrieve the name of the anonymous
>> class?
> 
> It would return what it does:
> irb(main):001:0> class << "foo"; self; end
> => #<Class:#<String:0x2b82264>>
> 

...which isn't that output.  Maybe you shoot for accuracy rather than 
quantity.


Gavin Kistner wrote:
> On Feb 14, 5:08pm, 7stud -- <bbxx789_0... / yahoo.com> wrote:
>>I would imagine the anonymous class does not have a .class
>> attribute...
> 
> Also not true:
> 
> irb(main):002:0> class << "foo"; self; end.class
> => Class
> 
> The class is, unsurprisingly, an instance of Class.

Thanks for your insightful post.

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