From: matz@... Date: 2019-01-10T08:28:09+00:00 Subject: [ruby-core:90981] [Ruby trunk Feature#6198][Rejected] public/protected/private with attr_* Issue #6198 has been updated by matz (Yukihiro Matsumoto). Status changed from Assigned to Rejected There's no use for `private` attr_reader, attr_writer, etc. And `protected` is not encouraged enough for new features. So I reject this. Matz. ---------------------------------------- Feature #6198: public/protected/private with attr_* https://bugs.ruby-lang.org/issues/6198#change-76198 * Author: riskwa (riskwa anon) * Status: Rejected * Priority: Normal * Assignee: matz (Yukihiro Matsumoto) * Target version: ---------------------------------------- I'd like to set visibility like this: class X protected attr_accessor :x, :y end attached patch(for 1.9.3-p125) is sample implementation (it seems to pass test-all) - make attr_* to return array of method-symbols which attr_* concerns (e.g. [:x, :x=, :y, :y=]) - make public/protected/private to accept array of symbols ---Files-------------------------------- 0000-attr-with-visibility.patch (8.32 KB) -- https://bugs.ruby-lang.org/ Unsubscribe: