On Feb 13, 2008 4:47 AM, Jari Williamsson
<jari.williamsson / mailbox.swipnet.se> wrote:
> How can I test if an instance method is defined for a class, without
> having to create an instance of that class?
>
> Simple example: Test if 'length' defined for the 'String' class?
>
>
> Best regards,
>
> Jari Williamsson

I don't know if it's the best way, but there is #instance_methods

irb(main):008:0> Fixnum.instance_methods.grep /ins/
=>["inspect", "instance_variable_defined?", "instance_variables",
"instance_variable_get", "instance_of?", "instance_eval",
"instance_variable_set"]

Todd