From: Stefano Crocco Date: 2007-04-17T21:38:28+09:00 Subject: Re: iterate through an array of method names to an object Alle marted� 17 aprile 2007, cammo ha scritto: > But also the send method will expect to get a symbol not a string so > you'll need to do something like > > functions.each do |funk| > � � funk.to_sym > � � puts name_o_my_object.send(funk) > � end > > I tried that in irb and it worked so fingers crossed should work for > you too. > > Cam send accepts both a string or a symbol. The documentation for Object#send, states object.send(symbol, [args...]) and the documentation of Object class, says: In the descriptions of Object's methods, the parameter symbol refers to a symbol, which is either a quoted string or a Symbol Besides, your own code passes a string to send, since funk.to_sym returns a symbol, but doesn't change what is stored inside funk, so when funk is passed to send, it still contains a string. Stefano