From: rubyist@... Date: 2014-07-18T09:08:54+00:00 Subject: [ruby-core:63817] [ruby-trunk - Bug #10060] [Open] private attr_accessor and NoMethodError Issue #10060 has been reported by John Doe. ---------------------------------------- Bug #10060: private attr_accessor and NoMethodError https://bugs.ruby-lang.org/issues/10060 * Author: John Doe * Status: Open * Priority: Normal * Assignee: * Category: * Target version: * ruby -v: ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-linux] * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN ---------------------------------------- ~~~ class Bug def initialize self.n = 1 # ok end def t1 self.n = n + 1 # ok self.n += 1 # in `t1': private method `n' called for # (NoMethodError) end def t2 n # ok self.n # in `t2': private method `n' called for # (NoMethodError) end private attr_accessor :n end ~~~ -- https://bugs.ruby-lang.org/