From: Gavin Sinclair Date: 2003-05-06T10:15:05+09:00 Subject: Re: Variable/Method ambiguity On Tuesday, May 6, 2003, 10:49:44 AM, Gennady wrote: > Pickaxe p.212 explains the subject well enough, however here's an interesting case: > class Test > def name=(name) > puts "Called 'name=' ..." > end > def test > name = "aaa" > end > end > Test.new.test > I would expect to see "Called 'name=' ...", as Ruby can realize here > that method "name=" is available and call it. However, nothing is > printed, meaning that an assignment to local variable "name" took > place. Use self.name = "aaa" to call the method. I'll leave it to others to comment on perceived inconsistency. Cheers, Gavin