from http://www.ruby-doc.org/docs/ProgrammingRuby/language.html#table_18.4
Method | Operator | Description |
---|---|---|
Y | [ ] [ ]= |
Element reference, element set |
Y | ** |
Exponentiation |
Y | ! ~ + - |
Not, complement, unary plus and minus (method names for the last two are +@ and -@ ) |
Y | * / % |
Multiply, divide, and modulo |
Y | + - |
Plus and minus |
Y | >> << |
Right and left shift |
Y | & |
Bitwise `and' |
Y | ^ | |
Bitwise exclusive `or' and regular `or' |
Y | <= < > >= |
Comparison operators |
Y | <=> == === != =~ !~ |
Equality and pattern match operators (!= and !~ may not be defined as methods) |
&& |
Logical `and' | |
|| |
Logical `or' | |
.. ... |
Range (inclusive and exclusive) | |
? : |
Ternary if-then-else | |
= %= { /= -= += |= &= >>= <<= *= &&= ||= **= |
Assignment | |
defined? |
Check if symbol defined | |
not |
Logical negation | |
or and |
Logical composition | |
if unless while until |
Expression modifiers | |
begin/end |
Block expression |