From: Robert Klemme Date: 2013-03-30T07:19:24+09:00 Subject: Re: Ruby Typing? --20cf3074d2e8ce526004d917a972 Content-Type: text/plain; charset=ISO-8859-1 On Fri, Mar 29, 2013 at 5:47 PM, Adam Prescott wrote: > You could also try x.to_int + y.to_int and use respond_to?(:to_int) > for detection. Equally with #to_ary. Duck typing! > Why use respond_to?(:to_int) for detection if you write x.to_int + y.to_int anyway? That's redundant work and _not_ Duck Typing. Cheers robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/ --20cf3074d2e8ce526004d917a972 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable



On Fri, Mar 29, 2013 at 5:47 PM, Adam Prescott &l= t;adam@aprescott.co= m> wrote:
You could also try x.to_int + y.to_int and use respond_to?= (:to_int)
for detection. Equally with #to_ary. Duck typing!

Why use respond_to?(:to_int) for detection if you wr= ite=A0x.to_int + y.to_int anyway? =A0That's redundant work and _not_ Du= ck Typing.

Cheers

robert

--
remember.guy do |as, often| = as.you_can - without end
= http://blog.rubybestpractices.com/
--20cf3074d2e8ce526004d917a972--