Feature #7614

alias_accessor

Added by Thomas Sawyer over 1 year ago. Updated about 1 year ago.

[ruby-core:51109]
Status:Open
Priority:Normal
Assignee:Yukihiro Matsumoto
Category:core
Target version:next minor

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

History

#1 Updated by Koichi Sasada about 1 year ago

  • Assignee set to Yukihiro Matsumoto

Also available in: Atom PDF