From: Igor Pirnovar Date: 2009-02-27T06:38:11+09:00 Subject: Re: "def nothing=(data) false end" returns 'data' instead of 7stud -- wrote: > > class A > def nothing(data) > return "hello" > end > end > > a = A.new > puts a.nothing=(123) > > --output:--r1test.rb:51: > undefined method `nothing=' for # (NoMethodError) Sorry, typo "puts o.nothing=(123)" should be "puts o.nothing(123)". It should be obvious that I screwed up, because i said: >> Take away the equal sign and it will behave like >> you'd expect it. Therefor, this is what I meant: +-----------------------+ | class MyTest | | def nothing(data) | | return false | | end | | end | | o = MyTest.new | | puts o.nothing(123) | |-----------------------| |OUTPUTS: false | +-----------------------+ -- Posted via http://www.ruby-forum.com/.