Articles about Ruby, the language

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. Split method for a Ruby array Let’s start with a simple example : Yikes! It returns a 2D-Array. After all, it’s logical because you have asked to separate the …

Ruby Split Array Read More »

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. Nature of arrays As we have seen in other blog entries, arrays and hashes are basic concepts in any programming language. It is the best way to encapsulate and organize data. …

Sort a Ruby array Read More »

Ruby multiline String

We will explore multiple scenarios where the display of a simple String in Ruby on multiple lines could be useful. What is a multiline string ? A multiline string is a string that, when displayed, returns the output in more than one line. With Ruby, there are different ways to create multiline strings. In this …

Ruby multiline String Read More »

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. Intro Operators are a basic tool in programming languages. The main ones are arithmetic and comparison operators. Ruby includes the ternary operator, which encapsulates both: an if statement and a comparison in a single …

Ruby ternary operator Read More »

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. Ruby String Strings are one of the main and most used classes in programming languages. A string is a container of character sequences. Typically, strings represent text, but they can encapsulate any character …

Ruby Substring Read More »

Ruby vs JavaScript

Ruby and JavaScript and two fantastic languages for the web. Let’s see the difference between them, to help you to learn Javascript if you know Ruby, and vice-versa. JavaScript and Ruby are beautiful ❤ The choice of the programming language will definitely affect what projects you will create and what companies you will be able …

Ruby vs JavaScript Read More »

Ruby loops overview

Understanding loops and how they work will help you write robust and efficient applications and interfaces. What is a loop? We can explain looping as the action of repeating the same thing over and over. In programming, as in real life, we need assembly lines. Imagine a cake factory that has a defined process: mix …

Ruby loops overview Read More »

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. Introduction to the enumerable module Modules are the major result of inheritance, since they allow us to execute actions without having to write code and sharing features …

Ruby Enumerable Module Read More »

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). What is object oriented programming (OOP)? Object Oriented Programming aims to bring the logics of the real world to programming languages in order to …

Ruby inheritance Read More »

Scroll to Top