Jari Williamsson wrote:
> Michal Gabrukiewicz wrote:
> 

> 
>> THE INTERESTING THING: 'get_foo' works with 'x' and 'self.x'
> 
> Yes, but with different result behind the scenes. 'x' is the same as
> 'x()', while 'self.x' is the same a '@x'


I think this is not correct. Since there are no local variable "x" in 
method get_foo, bot "x" and "self.x" will send message x to self.

If you reopen class User:

class User
  def x
    "2"
  end
end

Both x and self.x in get_foo will return "2", even if @x is "1"

Regards,
--
Cláudio Caseiro

-- 
Posted via http://www.ruby-forum.com/.