Use eval to run a statement dynamically : eval « Development « Ruby






Use eval to run a statement dynamically


#!/usr/bin/env ruby

eval "puts 'Hello, myValue!'" # => Hello, myValue!

 








Related examples in the same category

1.Execute an eval in a thread
2.Evaluation with variable
3.eval with variable name
4.Add a new method with eval