From: Chad Fowler Date: 2003-10-03T06:12:12+09:00 Subject: Re: newbie question: function overloading On Fri, 3 Oct 2003, Weirich, James wrote: # I would do it like this ... # # class SomeType # def somefunction # expression1 # end # end # # class SomeOtherType # def somefunction # expression2 # end # end # # Then just call: # # a.somefunction # # If you still feel the need to pass obj as an argument to somefunction, you # can always use: # # def somefunction(a) # a.somefunction # end # # And if you'd like to see that diagrammed: http://www.refactoring.com/catalog/replaceConditionalWithPolymorphism.html :)