Inversion of Control
This lesson explains how the principle of inversion of control works in Ruby.
In Ruby, there are a lot more methods that accept blocks, and they do very different things. However, they have one thing in common:
By accepting a block, from you as a programmer, the method can pass control to you.
This design is an example for the principle of inversion of control, and it’s the real reason why Rubyists love blocks so much.
What
...Create a free account to access the full course.
By signing up, you agree to Educative's Terms of Service and Privacy Policy