Unlike switch statements in many other languages, Ruby’ s case does not have fall- through, so there is no need to end each when with a break. You can also specify multiple matches in a single when clause like when " foo", " bar". This chapter explores more of ruby' s control structures. 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. 58 thoughts on “ Switch- case statement in Python”.
ruby case statement fall through sheetrock
would be to use ruby’ s case 😉. a X- hundred line switch statement in C. I get that fall- through is.