Sylvain Joyeux
2014-10-08 23:30:09 UTC
Ruby 2.0 introduced keyword arguments. The syntax used for them is:
function(name: value)
which replaces the old familiar hash syntax when the key is a symbol
(which is the common 'keyword argument' case)
function(:name => value)
I strongly suggest that you start using the former instead of the
latter in your ruby scripts. 2.0 and 2.1 both have backward
compatibility built-in (for keyword arguments), but it will disappear
at some point. Rock developers should definitely start converting the
old syntax to the new one bit by bit.
Sylvain
function(name: value)
which replaces the old familiar hash syntax when the key is a symbol
(which is the common 'keyword argument' case)
function(:name => value)
I strongly suggest that you start using the former instead of the
latter in your ruby scripts. 2.0 and 2.1 both have backward
compatibility built-in (for keyword arguments), but it will disappear
at some point. Rock developers should definitely start converting the
old syntax to the new one bit by bit.
Sylvain