From: Adam Prescott Date: 2011-08-26T21:56:18+09:00 Subject: Re: operator overloading ? --00151747b19a25aead04ab681214 Content-Type: text/plain; charset=UTF-8 On Fri, Aug 26, 2011 at 1:36 PM, jack jones wrote: > def >>a # I wanted to use this operator in order to put an object of > class whatever > puts a.str > end > object = Whatever.new(10) > >>object # why doesn't it work? > Your syntax is off. Here's an example of defining #>> class X def >>(other) p [self, other] end end x = X.new y = 1 x >> y #=> [#, 1] --00151747b19a25aead04ab681214--