3 ms·
I actually believe the &:symbol syntax was added in 1.8.7 since I am 100% positive we use that in our codebase which still has not been ported to 1.9. $ ruby
by jeltz 15y ago
I actually believe the &:symbol syntax was added in 1.8.7 since I am 100% positive we use that in our codebase which still has not been ported to 1.9.
$ ruby -e 'puts VERSION; p ["10", "2", "3"].sort_by(&:to_i)'
1.8.7
["2", "3", "10"]
- koenigdavidmj 15y agoRails adds it too, even if your version of Ruby does not support it. Yay monkeypatching! EDIT: said duck typing first. It's too early for thinking.