Probably everybody knew that, but I didn’t when I readed at the Programming Ruby book.
I was use to the no so sexy syntax for the hashes in Ruby:
1
|
|
Although is very common to see them at code using symbols as keys and split the elements into lines:
1 2 3 4 5 |
|
which, actually, looks nicer… (at least to me)
But in Ruby 1.9 they decide that if this was so common, maybe it could me a good idea simplify it. So now we can do the same by doing:
1 2 3 4 5 |
|
It is less verbose and, I think, more natural.