From: 7stud -- Date: 2007-09-23T05:51:45+09:00 Subject: Re: foo || 0 will cause exception but not for himself Gavin Kistner wrote: > On Sep 22, 7:26 am, SpringFlowers AutumnMoon > wrote: >> so how about just a method not inside a class, can it be named "foo=" as >> well? if so, how does Ruby know foo=1 is really an assignment or a >> method call foo=(1)? >> >> Ruby doesn't seem to like "foo=" as a method: > > self.foo = 10 def foo=(val) "hello" end puts self.foo = 10 #10 -- Posted via http://www.ruby-forum.com/.