Evaluating a String
suggest changeA string of Ruby source can be evaluated at runtime. eval runs it as code in the current scope.
class Example
def self.foo
:foo
end
end
eval "Example.foo" #=> :foo
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents