Project

General

Profile

Actions

Feature #6198

closed

public/protected/private with attr_*

Added by riskwa (riskwa anon) about 12 years ago. Updated over 5 years ago.

Status:
Rejected
Target version:
-
[ruby-core:43589]

Description

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) 0000-attr-with-visibility.patch riskwa (riskwa anon), 03/25/2012 02:58 AM

Related issues 2 (0 open2 closed)

Related to Ruby master - Feature #3753: value of def-exprClosedusa (Usaku NAKAMURA)08/28/2010Actions
Has duplicate Ruby master - Feature #6470: Make attr_accessor return the list of generated methodClosedmatz (Yukihiro Matsumoto)Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0