From: Phlip Date: 2009-04-21T01:25:04+09:00 Subject: Re: Polymorphism Michael Satterwhite wrote: > As much as I like Ruby, I do miss the polymorphic behavior of routines > in Java and C++. There are frequently times in which it would be useful > to have constructors (or routines) that take different arguments. I do > see some constructors that may take arguments of different types, so I > know people are doing it, but I'm curious as to how. That's "overloading", not "polymorphism". You do that in Ruby like this: def zone(*args) args.each do |arg| case arg when String string_zone(arg) when Fixnum fixnum_zone(arg) when MechaBattle mecha_battle_zone(arg) end end end From here, learn what real polymorphism is! You prob'ly already use it... -- Phlip