It’s the Ruby 1.9 “stabby lambda” operator. For example, see this article from 2008.
Nutshell:
> foo2 = ->(arg) { arg * 2 }
> foo2.call "now"
=> nownow
Note the lack of space between -> and (arg), that’s intentional.
It’s the Ruby 1.9 “stabby lambda” operator. For example, see this article from 2008.
Nutshell:
> foo2 = ->(arg) { arg * 2 }
> foo2.call "now"
=> nownow
Note the lack of space between -> and (arg), that’s intentional.