Build a Monster Class: Part 42:49 with Jason Seifer
In this stage, we'll be working towards creating our own class that uses blocks, arrays, hashes, and more. In this video, we'll learn a neat trick about yielding to blocks.
The following code will return the current object in context to a block:
yield self if block_given?
This is useful in cases where you would like to have access to the class inside of a block.
You need to sign up for Treehouse in order to download course files.Sign up