Montag, 23. Februar 2009

First steps with ruby

Today i did my first steps with ruby. I stepped through the 20 minutes tutorial, and i wonder, wether it is possibly, to overload functions in ruby.

My first lines were like this:

def hello
puts "hello"
end

def hello(name)
puts "hello #{name}"
end

hello
hello("Jens")


It turned out, that ruby only knew the second definition of hello, the first one, without parameters, seems to be overwritten.

On the other hand, it is quite simple to write unit tests, see Unit Tests with ruby.

Keine Kommentare:

Kommentar veröffentlichen