Project

General

Profile

Actions

Feature #6198

closed

public/protected/private with attr_*

Added by riskwa (riskwa anon) over 12 years ago. Updated almost 6 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

Updated by mame (Yusuke Endoh) over 12 years ago

  • Status changed from Open to Assigned
  • Assignee set to matz (Yukihiro Matsumoto)

This issue is strongly related to #3753.

--
Yusuke Endoh

Updated by mame (Yusuke Endoh) about 12 years ago

  • Target version set to 2.6
Actions #3

Updated by naruse (Yui NARUSE) almost 7 years ago

  • Target version deleted (2.6)

Updated by matz (Yukihiro Matsumoto) almost 6 years ago

  • 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.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0