Eval method in ruby executes string/expression passed as parameter.
Example:
irb > eval("5+3")
=> 8
irb > eval("a=5")
=> 5
irb > eval("b||=a")
=> 5
Its part of ruby meta-programming and not recommended approach unless there is no any alternative to do.
Recent Posts |
Followers |
|
© 2009-2010 FunOnRailsDesigned by Woork