Chapter 2: Installation and Setup

To use Ruby, we first have to install it on our computer. In this section, we’ll install the latest version of Ruby. If you’re on a Mac, it already comes with Ruby. However, it’s most likely an older version of Ruby.

Read More

Chapter 4: Variables

It’s time to dive into various interesting features of Ruby. We’ll start with the most basic concept in programming: variables.

Read More

Chapter 5: Comments

Sometimes, you want to add helpful notes and instructions to your code for others, even you. Trust me, when you come back to a piece of code you wrote six months ago, it’s often hard to figure out what it does.

Read More

Chapter 6: Operators

Ruby supports all the operators you learned in high-school Maths, and many more. In this section, we’ll learn about operators in Ruby.

Read More

Chapter 7: Strings

A string is simply a list of characters, for example ‘hello world’ and ‘abcd’. The characters don’t necessarily have to mean anything. In real programs, you may use strings to insert and display text on the web page. Open any website. Whatever text you see there, it’s all made up of strings.

Read More

Chapter 8: Symbols

Symbols are simply strings that are guaranteed to be unique. Instead of quotes, symbols are indicated by adding a colon : character behind the word. For example, :gmail is a symbol. If you create another :gmail it will represent the same symbol you created earlier.

Read More

Chapter 10: Hash

A Hash is similar to an Array, but stores a list of key-value pairs. In an array, each element has a positional index, but a Hash key can be anything, and the key has to be unique.

Read More

Chapter 11: Conditions

We’ve seen the comparison operators like <, >, <=, >=, ==, ===, !, !=, etc. These operators are typically used in control statements, like conditionals, loops, etc. Conditionals are the first control structure we’ll see.

Read More

Chapter 12: Loops

Loops are another super useful control structure that lets you repeat a piece of code for a certain number of times, or until a condition is met.

Read More