From: MonkeeSage Date: 2006-09-21T01:10:13+09:00 Subject: Re: Ducktator - A Duck Type Validator Austin Ziegler wrote: > No, you better not. If I use #<<, then I can "write" to a String, a > StringIO, an IO (socket, file, etc.), or an Array. Checking for #write > limits you to (mostly) actual IO objects. Then you'd be asking if the object _acts like_ (quacks like) an enumerable, would you not? Why wrap that in a begin....rescue clause and only spot it after the fact when you can catch it ahead of time? Certainly it doesn't violate duck-typing to ask what an object acts like (which is what imposing conditions on an object would be doing)?! Regards, Jordan