Discussion:
[Rock-dev] One element of Ruby syntax
Sylvain Joyeux
2014-10-08 23:30:09 UTC
Permalink
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

Loading...