The Ruby Way, Second Edition: Solutions and Techniques in Ruby Programming (2nd Edition)

 

   

Ruby Way

By Hal Fulton

Slots : 1.0

Table of Contents
 

Both Ruby and Python have these keywords: and, break, class, def, else, for, if, in, not, or, return, and while. The keyword def is used only for method definitions, and in is used only with for loops, not conditionals (use include? for that purpose).

Ruby has additional keywords not listed here. It does not have: assert, continue, del, elif, except, exec, finally, from, global, import, is, lambda, pass, print, raise, or try as keywords. You can use next in place of continue, and begin/rescue/ensure in place of try/except/finally. You will see exec, lambda, print, and raise as built-in methods in Ruby.


   
 

Категории