Complete Guide to The Ruby Enumerable Module

What is Enumerable? Enumerable is a collection of iteration methods, a Ruby module, and a big part of what makes Ruby a great programming language. Enumerable includes helpful methods like: map select inject Enumerable methods work by giving them a block. In that block you tell them what you want to do with every element. … Read more

Exploring MRI Source Code

If you have been using Ruby for a while you may be curious about how some things work under the hood. One way to dig deep into Ruby internals is by reading the source code that makes it work. Even if you don’t know C, you can still pick up some interesting things. The source … Read more

The Ultimate Guide to Blocks, Procs & Lambdas

Ruby blocks, procs & lambdas. What are they? How do they work? How are they different from each other? You will learn that & a lot more by reading this post! Understanding Ruby Blocks Ruby blocks are little anonymous functions that can be passed into methods. Blocks are enclosed in a do / end statement … Read more

11 Ruby Tricks You Haven’t Seen Before

Looking for some cool Ruby tricks? You found them! In this article I want to share with you some of my favorites. Contents Deep copy When you copy an object that contains other objects, like an Array, only a reference to these objects is copied. You can see that in action here: food = %w( … Read more