Category Things to better understand

Procs and lambdas

You know how everything in Ruby is an object, well, as it turns out that’s not quite true. Ruby blocks are not objects! So, blocks are not objects, but you can turn them into objects without too much trouble. We do this by wrapping our block in an instance of the Proc class… PROCS: Very standard to pass along a code block […]

The tap method

I haven’t found great explanations for this yet but there is a video below… The tap method is available to all Ruby objects and serves as a way to have a block “act on” the method’s caller and return the object called. Per the Ruby docs, “the primary purpose of this method is to ‘tap […]