Реклама

Ruby – control structures

This chapter explores more of ruby’s control structures. case We use the case statement to test a sequence of conditions. This is superficially similar to switch in C and Java but is considerably more powerful, as we shall see. 2..5 is an expression which means the range between 2 and 5, inclusive. The following expression tests whether…