From: Joel VanderWerf Date: 2010-06-08T01:18:50+09:00 Subject: [ruby-core:30638] [Bug #3406] attr_accessor creates a private writer method Bug #3406: attr_accessor creates a private writer method http://redmine.ruby-lang.org/issues/show/3406 Author: Joel VanderWerf Status: Open, Priority: Normal Category: core, Target version: 1.9.2 ruby -v: ruby 1.9.2dev (2010-05-31) [x86_64-linux] (Also, there is a warning that may be incorrect.) $ cat t.rb module M private def attr_accessor(*args); super; end end class C extend M attr_accessor :x end C.new.x = 1 $ ruby19 -v t.rb ruby 1.9.2dev (2010-05-31) [x86_64-linux] t.rb:3: warning: private attribute? t.rb:11:in `
': private method `x=' called for # (NoMethodError) ---------------------------------------- http://redmine.ruby-lang.org