I am new to Ruby. I'm trying to convert a string to a method call in
Ruby. I intend to store all my function calls in an Excel Worksheet and
use the extracted strings to make the actual method call. But I am not
able to convert the string obtained from the excel and use it as a
function call. I read somewhere that the Send() method helps convert
strings to method calls. But I am not able to use it correctly. For the
code mentioned below I obtain a "in `<top (required)>': undefined method
`Execute_Statement(5)' for main:Object (NoMethodError)"


************************************************************************************
 begin
           def Execute_Statement(var1)
    puts("Hello",var1)
  end
end

x='Execute_Statement(5)' #This would be fed from the Excel Worksheet

send(x)

************************************************

What am I doing wrong ?

-- 
Posted via http://www.ruby-forum.com/.