I don\'t understand completely how named parameters in Ruby 2.0 work.
def test(var1, var2, var3)
puts \"#{var1} #{var2} #{var3}\"
end
test(var3:\"var3-ne
Firstly, the last example you posted is misleading. I totally disagree that the behavior is similar to the one before. The last example passes the argument hash in as the first optional parameter which is a different thing!
If you do not want to have a default value, you can just use nil
.
If you want to read a good writeup, see "Ruby 2 Keyword Arguments".