From: Sam Roberts Date: 2004-04-26T06:44:30+09:00 Subject: Re: How do you know it quacks like a duck? is there a list of special methods? Quoteing djd15@po.cwru.edu, on Tue, Apr 20, 2004 at 05:22:23AM +0900: > All the methods I can think of in the standard library that do different > things based on what they're passed, though, actually check the class of > the object (I think). I was reminded by this in a recent post, which said the ruby stdlib had been changed to use the presence of :read as a method to indicate an object is IO-like. In that case, the categories I'm aware of are: # Class respond_to? String :to_str Array :to_ary IO :read Symbol :id2name (or is this silly? are only Symbols symbol-like?) Are there other "signature" methods? Would be useful on the wiki page, maybe under ruby-idioms? Cheers, Sam