Overview - Send for calling methods dynamically
What is it?
In Ruby, the 'send' method lets you call another method by its name stored as a symbol or string. Instead of writing the method name directly, you pass it as an argument to 'send', and Ruby runs that method for you. This allows you to decide which method to call while the program is running, not just when you write the code.
Why it matters
Without 'send', you would have to write every method call explicitly, making your code less flexible and harder to change. 'Send' lets programs adapt by choosing methods on the fly, which is useful for things like handling user input, building reusable code, or metaprogramming. It makes Ruby powerful for dynamic tasks and reduces repetitive code.
Where it fits
Before learning 'send', you should understand how to define and call methods normally in Ruby. After mastering 'send', you can explore metaprogramming techniques, method_missing, and dynamic proxies that rely on calling methods dynamically.