From: Eric Christopherson Date: 2012-04-16T01:41:34+09:00 Subject: Re: Operator overloading of the subscript operator On Sat, Apr 14, 2012 at 10:48 AM, Ralph Shnelvar wrote: > I have the Pickax book and I see two places operator overloading is mentioned: pages 130 and 345. > > Isn't there official documentation about the Ruby core? > > > If one looks at page 333 which lists all the operators that are expressed as methods, one sees that subscript is the only one where the expression goes lexically inside the operator.  As a special > case shouldn't this be documented somewhere official? There's also Kernel#`, which is called when you put something inside backticks or %x{}. Unlike [] and []=, though, trying to override it in your own classes doesn't have any effect.