From: Bil Kleb Date: 2006-10-17T11:35:12+09:00 Subject: dynamically assigning instance variables (redux) I need a modern answer to Daniel Berger's 2002 post, http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/39534 Is there a way to dynamically assign instance variables? class SomeClass def initialize(hash) hash.each do |key,val| @#{key} = val # Doesn't work end end end Actually, I'd like the assignment and make them attr_readers too. Nearly meta-programming clueless, -- Bil Kleb http://fun3d.larc.nasa.gov