Making a habit of checking type is indeed not the way to Ruby
Zen, but it is occasionally useful to write code that can take a
duck _or_ a zebra.

Imagine a method that will take either a Color object, or a
string or symbol with the color name:

     def scribble(color)
       color = Color.lookup(color) unless color.is_a?(Color)
       ...
     end

I imagine it is for purposes such as this that the tutorial
is teaching how to tell whether you've got a duck.

On 06/02/2014 12:14 PM, Eric MSP Veith wrote:
 > So, sure you can check whether a class would respond to a set of 
methods, like
 > you did with .respond_to? or by examinating the arrays returned by 
.methods or
 > .instance_methods.
 >
 > Still, that seems to be alot like forcing a Java/C++ pattern on Ruby. 
Perhaps
 > somebody else can comment on this, but my guess would be that this is 
not the
 > way to Ruby Zen?