Zoonk icon

Ruby (programming language)

Ruby is an interpreted, high-level, general-purpose programming language. It was designed and developed in the mid-1990s by Yukihiro "Matz" Matsumoto in Japan.

Ruby is dynamically typed and uses garbage collection. It supports multiple programming paradigms, including procedural, object-oriented, and functional programming.

Show a practical example
How to perform simple calculations using Ruby

Doing simple calculations in Ruby is similar to other programming languages. First of all, open your Interactive Ruby (IRB) environment. Sum 5+2 => 7 Subtraction 5-2 => 3 Multiplication

What's the scope of a local variable in Ruby?

Understanding a variable's scope is important to know when it's going to be called and what values can be changed. You can have a variable with the same in different places of your code but its valu

How to find a variable's type in Ruby?

Sometimes it might be useful to know what type a variable has. Because variables are just objects, you can use the method to get its class (or type): > name = "Da Vinci" > name.class => String > p

What's the difference between variables and constants in Ruby?

Constants are variables whose name start with an uppercase letter: NAME = "Leonardo da Vinci" Different from variables, however, constants are not meant to be changed. When you try to assign a ne