While learning Ruby I've come across the "=>" operator on occasion. Usually I see it in the form of
:symbol => value
and it seems to be used frequently when passing values to functions. What exactly is that operator called? What does it do/mean? Is it built into Ruby or is it something that different frameworks like Rails and DataMapper add to the symbol class? Is it only used in conjunction with the symbol class? Thanks.
foo: bar
, which creates the key as the Symbol:foo
. – Cab