From: Markus Hohenhaus Date: 2007-05-10T05:10:05+09:00 Subject: Re: using dynamic method calling with attr_writer methods > The problem is you are calling the 'getters' with an argument ('foo'). > Getters don't take an argument, thus the error message. You want: > > @methods.each { |a| puts test.send(a) } > > I added the puts, otherwise you won't get any output. Yep, this works perfectly. I already tested this. > > If you want to call the setters, you need to send a different method > name: > > @methods.each { |a| test.send("#{a}=", 'foo') } > > And of course you need to send an argument also. That's it!! Thanks. Now everything works as expected. Allthough I like mine better, seems more logical to me ;). -- Posted via http://www.ruby-forum.com/.