December 2017
Intermediate to advanced
860 pages
16h 1m
English
Ruby offers an interactive shell too. Working on the interactive shell will help us understand the basics of Ruby clearly. So, let's get started. Open your CMD/terminal and type irb in it to launch the Ruby interactive shell.
Let's input something into the Ruby shell and see what happens; suppose I type in the number 2 as follows:
irb(main):001:0> 2
=> 2
The shell throws back the value. Now, let's give another input such as the addition operation as follows:
irb(main):002:0> 2+3
=> 5
We can see that if we input numbers using an expression style, the shell gives us back the result of the expression.
Let's perform some functions on the string, such as storing the value of a string in a variable, as follows: ...
Read now
Unlock full access