Inversion of Control
Explore the principle of inversion of control in Ruby.
There are many more methods that accept blocks in Ruby, and they do very different things. However, they have one thing in common: a method that accepts a block from us can pass control to us.
This design is an example of the principle of inversion of control, and it’s the real reason why Rubyists love blocks so much.
What does that mean?
In short, it ...