From: Mike Stephens Date: 2011-01-28T05:16:30+09:00 Subject: Re: why is overloading invalid in ruby. I guess the answer to your question is "Because you don't need to" Overloading refers to two quite distinct situations. One is where you want to involve parameters of different classes. You might want to add two numbers or a number and a string. Ruby doesn't have anything like the problem with that compared to more typed languages. The Ruby term is "Duck Typing" which means Ruby will let you supply miscellaneous objects and then see if they work in the context. The second meaning - the one you demonstrated - is different numbers of parameters. As other have pointed out, you can supply different numbers of parameters to the same methods as long as you tell Ruby this might happen and tell it how to deal with all the possibilties - with certain constraints. The problem is your example is pretty meaningless. You would be unlikely to want to write a different method for each sum length. Think of a more realistic scenario and then see if Ruby doesn't deal with it. (In the meantime, notice you really don't need to wrap your code in the class Summer. I don't think it adds anything.) (Oh dear, I shouldn't have said that...) -- Posted via http://www.ruby-forum.com/.