Wrap-Up
Here are a few spells and other interesting things that you learned today:
-
What Scope Gates (Scope Gate) are and how Ruby manages scope in general
-
How to make bindings visible through scopes with Flat Scopes (Flat Scope) and Shared Scopes (Shared Scope)
-
How to execute code in an object’s scope (usually with instance_eval or instance_exec), or even in a Clean Room (Clean Room)
-
How to turn a block into an object (a Proc) and back
-
How to turn a method into an object (a Method or an UnboundMethod) and back
-
What the differences are between the different types of callable objects: blocks, Procs, lambdas, and plain old methods
-
How to write your own little DSL
That was a lot of new stuff in a single day. As you sneak out of the ...