From: "Joe Wölfel" Date: 2008-11-18T04:22:02+09:00 Subject: Re: How can I overload a method in Ruby It's interesting that without the feature of overloading the code is both shorter and more readable. On 17 nov. 08, at 03:05, Peña, Botp wrote: > From: Zhao Yi [mailto:youhaodeyi@gmail.com] > # def build() > # make > # end > # > # def build(directory) > # cd directory > # make > # end > # > # but without overloading, I have to do this: > # def build(directory) > # if(directory == nil) > # make > # else > # cd directory > # make > # endif > # end > > try it like, > > def build directory=nil > cd directory unless directory.nil? > make > end