Using send and eval
Discover how to execute dynamic method calls and evaluate strings as Ruby code.
1
Using send and eval
Ruby provides powerful methods like send and eval to dynamically execute code.
These methods allow calling methods dynamically and evaluating Ruby expressions at runtime.

2
What is the send Method?
send allows calling methods dynamically by name.
It can invoke private and public methods.
class Person
def greet
'Hello!'
end
end
p = Person.new
puts p.send(:greet)