Zoonk icon

Software development

creation and maintaining of programs and applications

Show a practical example
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