From: "ara.t.howard" Date: 2007-10-23T02:12:50+09:00 Subject: Re: Conflicts between using respond_to? and extending Ruby On Oct 22, 2007, at 10:39 AM, David A. Black wrote: > The distinction I see is proximity to the object. respond_to? is > asking the object about its capabilities, whereas kind_of? is asking > it about its ancestry. So respond_to? is a tighter fit with the object > as it is at a given point in runtime. it all depends - consider the case of trying to tell wether or not a hash, array, or rbtree is passed to a method. you can't use 'respond_to?("[]")', 'respond_to?("size")', etc. you can sometimes pick the 'right' method but, other times you cannot and case obj when Array ... is safer and more accurate. i think it really depends on the use case - i personally use both. cheers. a @ http://codeforpeople.com/ -- we can deny everything, except that we have the possibility of being better. simply reflect on that. h.h. the 14th dalai lama