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

How to Use Ruby Time & Date Classes

Time is a class in Ruby that helps you represent a specific point in time. After reading this article you’ll learn everything you need to know to become a Ruby time wizard! Topics covered: How to convert strings into time objects How to break down a time into components (day/hours/milliseconds…) How to use the Date, … Read more

Ruby Refactoring Techniques: An Introduction

If you aren’t familiar with the term, refactoring is the act of improving the quality of code without changing what it does. This will make your code a lot easier to work with. In this post you will learn some common Ruby refactoring techniques Let’s get started! Extract Method One of the most common refactorings … Read more

The Many Uses Of Ruby Case Statements

Whenever you need to use some if / elsif statements you could consider using a Ruby case statement instead. In this post, you will learn a few different use cases and how it all really works under the hood. Note: In other programming languages this is known as a switch statement. The components of a … Read more