> Why block can see local variables defined before him? Why can it change them? What kind of sorcery is this?
This is some kind of question that I will try to answer in my talk. We will see examples of block and hidden secret hero behind the magic - `binding` object.
In our magical journey we will look into some Ruby code and some MRI/Rubinius/jRuby internals to help us better understand the magic. We will later use the new knowledge in practice to:
* understand erb
* understand binding.pry
* write our own openstruct-like implementation that stores data internally using local variables inside binding. In benchmark it's faster than openstruct, so yay us! ;)
Great magicians never reveal their secrets - but thankfully Ruby is open source, so we can lift the veil and see the real truth behind it. And believe me, it's quite beautiful!