Реклама

Ruby – Back to the simple examples

Now let’s take apart the code of some of our previous example programs. The following appeared in the simple examples chapter. Because this is the first explanation, we examine each line individually. Factorials In the first line, def is a statement to define a function (or, more precisely, a method; we’ll talk more about what a method…