Ruby Keywords

Review a list of keywords in Ruby. These keywords are used in nearly all programs.

Keywords. Ruby is object-oriented. Most actions we take are done with methods, part of classes. Iterators (methods) replace loops. The language thus needs fewer keywords.

Keyword list. Ruby is a scripting language, so its implementation (Ruby Core) is the best source for information on its keywords. This list was built from its code.aliasbeginBEGINbreakcaseclassdefined?doelseelsifendENDensurefalseforifincludemodulenextnilpublicprotectedprivateredorescueretryselfsuperthentrueundefunlessuntilwhenwhileyield

Some methods. Ruby provides methods that are often used. These are not keywords, but are available in all places in programs. They are useful.p()printputsrandsrand

Certain keywords, like undef, are rarely used. But learning how they work helps us understand the Ruby language in a more complete way.

In modern Ruby programs, constructs like for-loops are avoided. We find that iterators (like upto and times) are a clearer approach. But these keywords are still provided.

In the world of programming, Ruby is a good language. A Ruby developer can write correct, useful programs fast. This is an important ability.

© 2007-2020 Sam Allen. Every person is special and unique. Send bug reports to info@dotnetperls.com.