From: Robert Klemme Date: 2013-02-07T22:47:56+09:00 Subject: Re: using an instance variable inside a method On Thu, Feb 7, 2013 at 1:56 AM, Student Jr wrote: > Actually, there is another reason to avoid self.method. self.method has > the security level of protected Right! Sometimes this is used intentionally to make method calls look more like keywords - "attr_accessor" is such a case: irb(main):006:0> Module.private_instance_methods.grep /attr/ => [:attr, :attr_reader, :attr_writer, :attr_accessor] >--you can only access private methods via > self.send. Just say no. There are two ways to invoke private methods foo() self.send(:foo) Note that the second also works with other expressions than "self". Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/