uses strings and interpolation with Dynamic Code Execution : eval « Reflection « Ruby






uses strings and interpolation with Dynamic Code Execution



my_number = 15
my_code = %Q{#{my_number} * 2}
puts eval(my_code)

 








Related examples in the same category

1.Dynamic Code Execution
2.Bindings