Code Reading Adventures: Awesome Print Gem

Awesome print is a nice gem that formats your output in irb & pry to make it more readable. For example… This is what displaying a hash with awesome_print looks like: But how does this work? “Truth can only be found in one place: the code.” ― Robert C. Martin Let’s take a look at … Read more

A Quick Analysis of How Sinatra Works

Sinatra is a Ruby web framework. It’s like Rails little brother… Let’s explore how Sinatra works: What happens when you require Sinatra into your project? How does route matching work? How are requests & responses processed? So many questions, but so little time… No problem! I did the hard work for you & put together … Read more

Practical Linked List in Ruby

This is the 3rd entry in the “Practical Computer Science in Ruby” series! Today we are going to talk about linked list. So what’s a linked list? Like the name says, a linked list is a way to store data in a list format (thanks, Captain Obvious!). The “linked” part comes from the fact that … Read more

Everything You Need to Know About Ruby Constants

What is a constant in Ruby? A constant is a type of variable which always starts with a capital letter. They can only be defined outside of methods, unless you use metaprogramming. Constants are used for values that aren’t supposed to change, but Ruby doesn’t prevent you from changing them. They look like this: Now: … Read more