Use "eval".

irb(main):001:0> def one
irb(main):002:1> puts "1"
irb(main):003:1> end
=3D> nil
irb(main):004:0> def two
irb(main):005:1> puts "2"
irb(main):006:1> end
=3D> nil
irb(main):007:0> metharray =3D ['one', 'two']
=3D> ["one", "two"]
irb(main):008:0> metharray.each { |e| eval e }
1
2
=3D> ["one", "two"]


On Tue, Feb 3, 2009 at 4:39 PM, Jason Shelton <jas.shelton / hotmail.com> wro=
te:
>
> Hello,
>
> I currently have an array of strings.  Let's say, for example, my array c=
ontains the following:
>
>                            ['one', 'two', 'three']
>
> Each element in my array is the name of a function in my program.  I want=
 to call the functions, using the array element.  So for example, lets say =
that my array is named 'numArray'.  I want to call the function in my progr=
am named 'one'.  I am now trying numArray[0].  Is there a way to make the n=
umArray[0] be recognized as 'one' and call the function?  If my question is=
 not clear, I can elaborate.  Thanks in advance for all help.
>
> - Shelton
> _________________________________________________________________
> Windows Live=99 Hotmail(R):=85more than just e-mail.
> http://windowslive.com/explore?ocid=3DTXT_TAGLM_WL_t2_hm_justgotbetter_ex=
plore_012009