On Fri, Oct 1, 2010 at 12:00 PM, Brian Candler <b.candler / pobox.com> wrote:
> Jes=FAs Gabriel y Gal=E1n wrote:
>> Shouldn't we be using respond_to? instead of method_defined? or
>> methods.include?.
>
> respond_to? only works on instances of objects, not when you're within
> the class.
>
> You could do "new.respond_to? ..." but if the initialize method needs
> arguments, you'll have to provide them.

Ah, you are right, I missed that we were not in an instance...
Anyway, be careful then with this technique, cause if the instance
would be handling that method call with method_missing you will not
know it using the above.

Regards,

Jesus.