Home
Ruby
ActiveRecord
Array
CGI
Class
Collections
Database
Date
Design Patterns
Development
File Directory
GUI
Hash
Language Basics
Method
Network
Number
Rails
Range
Reflection
Statement
String
Threads
Time
Tk
Unit Test
Windows Platform
XML
Menu
Evaluation with variable : eval « Development « Ruby
Ruby
Development
eval
Evaluation with variable
x = 1 eval
"x + 1"
# => 2
Related examples in the same category
1.
Use eval to run a statement dynamically
2.
Execute an eval in a thread
3.
eval with variable name
4.
Add a new method with eval