Ruby Syntax

The Ruby syntax is large and is split up into the following sections:

Literals

Numbers, Strings, Arrays, Hashes, etc.

Assignment

Assignment and variables

Control Expressions

if, unless, while, until, for, break, next, redo

Pattern matching

Experimental structural pattern matching and variable binding syntax

Methods

Method and method argument syntax

Calling Methods

How to call a method (or send a message to a method)

Modules and Classes

Creating modules and classes including inheritance

Exceptions

Exception handling syntax

Precedence

Precedence of ruby operators

Refinements

Use and behavior of the refinements feature

Miscellaneous

alias, undef, BEGIN, END

Comments

Line and block code comments

Operators

Operator method behaviors