Logics
Let’s dive into Ruby's control structures, iterators, and exceptions.
We'll cover the following...
We'll cover the following...
Method calls are statements. Ruby also provides a number of ways to make decisions that affect the repetition and order in which methods are invoked.
Control structures
Ruby has all the usual control structures, such as if statements and while loops. Java, C, and Perl programmers may get caught by the lack of braces around the bodies of these statements though, since Ruby uses the end keyword to signify the end of a body:
Similarly, while statements are terminated with end:
Ruby also contains variants of these statements. The unless statement is like if except that it checks for the condition to not be true. Similarly, until is like while except that the loop ...