Project

General

Profile

Actions

Feature #7614

open

alias_accessor

Added by trans (Thomas Sawyer) almost 12 years ago. Updated 8 months ago.

Status:
Assigned
Target version:
-
[ruby-core:51109]

Description

=begin
Prior issue reminded me that I've been meaning to ask for this for a while, as I use is fairly often.

In pure Ruby the definition is essentially:

def alias_accessor(name, origin)
  alias_method "#{name}=", "#{origin}="
  alias_method name, origin
end

Albeit pursuit to prior mentioned issue, I'd define it more like:

def alias_accessor(name, origin)
  writer_name = name.to_s.chomp('?')
  alias_method "#{writer_name}=", "#{origin}="
  alias_method name, origin
end

=end

Updated by ko1 (Koichi Sasada) over 11 years ago

  • Assignee set to matz (Yukihiro Matsumoto)
Actions #2

Updated by naruse (Yui NARUSE) almost 7 years ago

  • Target version deleted (2.6)
Actions #3

Updated by hsbt (Hiroshi SHIBATA) 8 months ago

  • Status changed from Open to Assigned
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0