From: Derek Cannon on
> maybe you could show us a sample use case of method overloading since
> i cannot think of one right now ;-)

Sure. A simple example of what I wanted to do (using method overloading
in this example for lack of better know-how):

Class XYZ

def initialize(title, days, time, professor)
@title = title
@days = days
@time = time
@professor = professor
end

def initialize(title, days, time, professor, lab_time, lab_days)
@title = title
@days = days
@time = time
@professor = professor
@lab_time = lab_time
@lab_days = lab_days
end

end
--
Posted via http://www.ruby-forum.com/.

From: Jesús Gabriel y Galán on
On Mon, Apr 19, 2010 at 10:39 AM, Derek Cannon
<novellterminator(a)gmail.com> wrote:
>> maybe you could show us a sample use case of method overloading since
>> i cannot think of one right now ;-)
>
> Sure. A simple example of what I wanted to do (using method overloading
> in this example for lack of better know-how):
>

This one is easy:

Class XYZ
def initialize(title, days, time, professor, lab_time=nil, lab_days=nil)
@title = title
 @days = days
 @time = time
 @professor = professor
 @lab_time = lab_time
 @lab_days = lab_days
end
end

Jesus.