Ruby Metaprogramming: Real-World Examples

You may have read about Ruby metaprogramming before. But… It can be a bit confusing if you don’t have a few specific examples. That’s why in this article: We’re going to look at some popular open-source projects using Ruby metaprogramming. Projects like: Rails Sinatra Paperclip gem All of them use some form of metaprogramming. Let’s … Read more

Learn to Use the Twitter API with Ruby

Do you want to learn how to write a Twitter application using Ruby? Then you are in the right place! In this post I will teach you, step-by-step, how to create a program that can interact with the Twitter API and do things like looking for certain keywords or send automated replies. Let’s get started! … Read more

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