From: ts Date: 2002-05-04T20:56:20+09:00 Subject: Re: dynamically assigning instance variables >>>>> "H" == Holden Glova writes: H> instance_eval(<<-EOS) [...] H> send("#{name}=", v) eval is evil, and it's still exist a stupid way to write it :-) pigeon% cat b.rb #!/usr/bin/ruby module Hab module Tmp def defin(a) attr_accessor a end end def self.append_features(c) super c.extend Tmp end def biv(attributes) attributes.each do |k, v| type.send(:defin, k) send(k.to_s + "=", v) end end end class A include Hab end a = A.new a.biv("aaa" => [1, 2], :bbb => [3, 4]) p a.aaa p a.bbb pigeon% pigeon% b.rb [1, 2] [3, 4] pigeon% Guy Decoux