Ruby Split Array

Split is a very common method not only in Ruby, but also in the programming world. Let's see what does .split means for a Ruby Array.

Posted December 22, 2022 - tagged ruby

3 min read

Sort a Ruby array

A short article about how to sort an array in Ruby. It's a classic problem in other languages too, so let's explore the Ruby case.

Posted December 15, 2022 - tagged ruby

3 min read

Ruby multiline String

We will explore multiple scenarios where the display of a simple String in Ruby on multiple lines could be useful.

Posted November 7, 2022 - tagged ruby

3 min read

Ruby ternary operator

Many languages have a ternary operator, including Ruby. The goal is to reduce the size of the code by displaying a one-line condition. Let's see how.

Posted October 24, 2022 - tagged ruby

3 min read

Ruby Substring

Ruby is an elegant and dynamic language. Today a simple topic about how to extract a Substring from an existing String in Ruby.

Posted October 10, 2022 - tagged ruby

4 min read

Ruby loops overview

Understanding loops and how they work will help you write robust and efficient applications and interfaces.

Posted August 29, 2022 - tagged ruby

5 min read

How to handle Ruby exceptions

Ruby developers can identify probable errors and handle them so that the application does not break. This is what we call exception handling.

Posted August 22, 2022 - tagged ruby

6 min read

Ruby Enumerable Module

The enumerable module is one of the most important modules in Ruby, it includes a wide range of methods that help us to interact with collections of data.

Posted July 4, 2022 - tagged ruby

6 min read

Ruby inheritance

Inheritance in Ruby and Ruby-on-Rails is a key element that has a great potential to develop robust interfaces. Inheritance is a concept which is directly related with Object Oriented Programming (OOP).

Posted June 27, 2022 - tagged ruby

5 min read

How to define and use a Ruby hash

A Ruby hash is a way to store and structure data. Let's see how to define a hash and how to use it. And the main methods and operations, through examples.

Posted June 2, 2022 - tagged ruby

6 min read

Ruby pattern matching

If you are not familiar with the pattern matching feature in Ruby, this article is a good recap of the basics and it also includes some useful tips for developers.

Posted May 19, 2022 - tagged ruby

Last update : April 19, 2022 5 min read

Ruby, the self keyword

In this article we will explore the self keyword of the Ruby language

Posted May 12, 2022 - tagged ruby

6 min read

How to get a random number in Ruby

Let's see how to get a random number in Ruby

Posted May 5, 2022 - tagged ruby

2 min read

Ruby block, procs and lambda

With the Ruby language, block, procs, and lambda are some different ways to use anonymous functions.

Posted April 28, 2022 - tagged ruby

6 min read

Ruby - attr_accessor, attr_writer, and attr_reader

In Ruby, object methods are public by default, while data is private. To access data, we use the accessor method.

Posted February 24, 2022 - tagged ruby

6 min read

Ruby constants

How to define constants in Ruby, and how to use them - with one tricky part.

Posted February 10, 2022 - tagged ruby

3 min read

Ruby regex, a friendly guide

Ruby regexes are not so easy to grab. We tried to make this little tutorial as simple as possible.

Posted February 3, 2022 - tagged ruby

Last update : June 20, 2022 7 min read

Milliseconds in Ruby

How to get milliseconds in Ruby ? Let's explore 3 scenarii.

Posted January 27, 2022 - tagged ruby

2 min read

Ruby, map with index

There's always a tiny doubt about how to "map with index" when using Ruby. Let's see how, and we're also going back to basics of Ruby map in this article.

Posted January 20, 2022 - tagged ruby

Last update : January 20, 2021 6 min read

Ruby strftime, short and long story

"strftime" stands for "string from time". Which means "please Ruby format the time into a human-friendly format". Let's see how.

Posted January 13, 2022 - tagged ruby

Last update : January 13, 2021 9 min read

Ruby Enumerator : the what, the why, the how

If you're on the path to learning Ruby then you might have heard of this thing called an 'Enumerator'. As scary as it sounds, Enumerators are actually your friends and will be helping you a lot on your journey to becoming a Ruby *aficionado*. Since they are so important, let's quickly get you up and running within this lesson. We will be going over the what, the why, and the how of Enumeration.

Posted January 6, 2022 - tagged ruby

Last update : March 11, 2022 7 min read

Ruby : The 'unless' keyword

You are probably familiar with the 'if else' control flow but there are certain situations where there may be a visually better way to write these statements. Here we will discuss how you can achieve this via the 'unless' keyword in Ruby and the different ways you can use it.

Posted June 18, 2021 - tagged ruby

3 min read

How to write a switch statement in Ruby

In Ruby, the classic 'switch statement' is possible with the *case/when* keywords. Whenever if statements become too long and start looking messy you might want to consider using the case statement to write cleaner code.

Posted April 27, 2021 - tagged ruby

4 min read

Ruby private method : a hack

A tiny hack about how to declare and use private method in Ruby.

Posted April 13, 2021 - tagged ruby

4 min read

Check emptiness in Ruby : nil? vs blank? vs empty? vs presence?

More often than not, you have to check if an object is empty or not, to avoid the famous *NullPointerException* - which is a *NoMethodError* in Ruby.

Posted March 30, 2021 - tagged ruby

7 min read