From: "ekkehard.horner" Date: 2007-03-26T04:25:05+09:00 Subject: Re: pointer to function Brian Candler schrieb: > On Mon, Mar 26, 2007 at 01:40:05AM +0900, ekkehard.horner wrote: [...] >> # Does send 'symbolize' the string? todo: check [...] > > Yes, send allows you to pass either a string or a symbol. The symbol is > actually used for method dispatch; if you pass a string then it will convert > it into a symbol first (you can do this explicitly using String#to_sym or > String#intern; I think they are just aliases) > > Regards, > > Brian. > Thanks Brian, I added def sendStr methods = { 'str0' => [ 'using "tell_it"', "tell_it" ] , } methods.each { |keyval| send keyval[ 1 ][ 1 ].intern, keyval[ 1 ][ 0 ] send keyval[ 1 ][ 1 ].to_sym, keyval[ 1 ][ 0 ] } end and learned: When in doubt, use ri (String#to_sym wasn't mentioned in "ProgrammingRuby.chm"). Regards Ekkehard