Project

General

Profile

Actions

Bug #10259

closed

send を使った attr_writer への書き込みができない場合がある

Added by mtsmfm (Fumiaki Matsushima) over 9 years ago. Updated over 9 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
2.2.0dev, 2.2.0-preview1
[ruby-dev:48559]

Description

class Hoge; attr_writer :a; end

Hoge.new.send(:"#{:a}=", 1)
# => 1 (ruby 2.1.2)
# hoge.rb:3:in `<main>': undefined method `a=' (ruby 2.2.0-preview1)

Related issues 2 (0 open2 closed)

Related to Ruby master - Bug #10283: Calling define_method with a dynamic symbol ending in = results in a NoMethodError when calling the method via assignment, until called via sendClosed09/22/2014Actions
Has duplicate Ruby master - Bug #10299: alias_method :new_foo=, :"#{:foo}=" doesn't work properly on ruby 2.2.0preview1.Closed09/27/2014Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0