On Feb 1, 2010, at 13:55 , James Edward Gray II wrote:

> On Feb 1, 2010, at 3:38 PM, Ryan Davis wrote:
> 
>> Personally, I usually map first:
>> 
>>>> Foo.constants.map { |s| Foo.const_get s }.find_all { |k| Class === k }
>> => [Foo::B]
> 
> Then you can switch the the under loved grep():
> 
>>> Foo.constants.map { |s| Foo.const_get s }.grep(Class)
> => [Foo::B]

Ah! I always forget about that one. Good catch.