From: nobu@... Date: 2014-09-23T00:30:18+00:00 Subject: [ruby-dev:48574] [ruby-trunk - Bug #10259] send を使った attr_writer への書き込みができない場合がある Issue #10259 has been updated by Nobuyoshi Nakada. Related to Bug #10283: Calling define_method with a dynamic symbol ending in = results in a NoMethodError when calling the method via assignment, until called via send added ---------------------------------------- Bug #10259: send を使った attr_writer への書き込みができない場合がある https://bugs.ruby-lang.org/issues/10259#change-49061 * Author: Fumiaki Matsushima * Status: Closed * Priority: Normal * Assignee: * Category: * Target version: * ruby -v: 2.2.0dev, 2.2.0-preview1 * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN ---------------------------------------- ``` class Hoge; attr_writer :a; end Hoge.new.send(:"#{:a}=", 1) # => 1 (ruby 2.1.2) # hoge.rb:3:in `
': undefined method `a=' (ruby 2.2.0-preview1) ``` -- https://bugs.ruby-lang.org/