Quantcast
Channel: Pixel Deep » tutorials
Viewing all articles
Browse latest Browse all 6

Jump Into Ruby with Pixel Deep – Reserved Words

$
0
0

Ruby LogoVirtual study group where I’ll share all the information learned so far about Ruby language from sources like Learn Ruby The Hard Way, Rubymonk and Treehouse

This is a work in progress, so all the feedback and critique is welcome!

Reserved Words -they are common in all programming languages and Ruby has 40 of them, which can be roughly divided into multiple categories:

Iteration – do, until, while, yield, next, for, in

Control Flow – if, else, elsif, unless, case, when, then

Blocks/Exception Handling –  return, begin, rescue, redo, break, ensure, retry

Classes/Modules –  module, class, def, undef, defined?, alias, super

Conditional – and, or, not

Truthy – true, false, nil

Scope – self

Files – begin, end, __line__

The most important part to remember is that we can’t use any of the above keywords for variables.

Ryan Davis’s website Zenspider  also provides quick reference on reserved Ruby words here.


Viewing all articles
Browse latest Browse all 6

Trending Articles