From: Mark Wilden Date: 2008-05-30T22:25:52+09:00 Subject: Re: The duck's backside On May 29, 2008, at 1:18 AM, Bill Kelly wrote: > > From: "Mark Wilden" >> >> So if I can solve a programming problem simply by asking what >> builtin class an object is, as opposed to seeing if it responds to >> a certain method name, knowing nothing about what that method >> actually does, I'll go with the former. > > There are more ducks in heaven and earth, Horatio, than are > dreamt of in your philosophy. > >>> require 'delegate' > => true >>> x = SimpleDelegator.new(123) > => 123 >>> x.class > => SimpleDelegator >>> x.kind_of? Numeric > => false >>> x.is_a? Numeric > => false >>> x.respond_to? :to_int > => true >>> x.to_int > => 123 Good point. ///ark