-
Notifications
You must be signed in to change notification settings - Fork 1
Operators
- (unary minus)
- (unary +) ~
! not
& (binary & or formal block arg)
- (binary minus) %
- (binary *) ** / (binary /) ^ |
- (binary +) << (left shift)
=~ !~
<
= <= <=> == != ===
=
&&= ||=
|= %= &= **= *= ^= -= += /= <<=
=
&& || ? (ternary ?:) and or
defined?
.. ...
%nonassoc modifier_if modifier_unless modifier_while modifier_until %left keyword_or keyword_and %right keyword_not %nonassoc keyword_defined %right '=' tOP_ASGN %left modifier_rescue %right '?' ':' %nonassoc tDOT2 tDOT3 %left tOROP %left tANDOP %nonassoc tCMP tEQ tEQQ tNEQ tMATCH tNMATCH %left '>' tGEQ '<' tLEQ %left '|' '^' %left '&' %left tLSHFT tRSHFT %left '+' '-' %left '*' '/' '%' %right tUMINUS_NUM tUMINUS %right tPOW %right '!' '~' tUPLUS
| No | Description | Operators | Associativity |
|---|---|---|---|
| 1 | Unary |
! ~ +
|
Right |
| 2 | Power | ** |
|
| 3 | Unary minus | - |
A Ruby Language Reference
Copyright © by Michael Hore, 2016.
Introduction to This Document
Ruby Elements
- Classes and Modules
- Methods
- Blocks, Procs and Lambdas
- Execution Context and Closures
- Variables, Constants and Namespaces
- Types and Literals
- Ruby Expressions
- Operators
Syntax Grammar
Exceptions and Throw
Ruby Sourcefiles and Libraries
Multi Threading
Execution and Lifecycle