This is a note to deepen understanding and review for the Ruby certification exam.
+@ and -@ are unary operators representing expressions like +50 or -36.
Compound assignment operators, which are combinations of operators, cannot be redefined. For example, += cannot be overridden.
Control structures describe the structure of a program as “executing in order,” “executing repeatedly,” or “executing based on conditions.” These are referred to as control structures.
| Cannot Override | Can Override |
|:-----:|:-----:|
| = | \| |
| ?: | ^ |
| .. | & |
| ... | <=> |
| not | == |
| && | === |
| and | =~ |
| \|\| | > |
| or | >= |
| :: | < |
| | <= |
| | << |
| | >> |
| | + |
| | - |
| | * |
| | / |
| | % |
| | ** |
| | ~ |
| | +@ |
| | -@ |
| | [] |
| | []= |
| | ` |
| | ! |
| | != |
| | !~ |
+@ and -@ are unary operators representing expressions like +50 or -36.
| Precedence | Operator |
|:-----:|:-----:|
| High | :: |
| | [] |
| | ! ~ +@ |
| | ** |
| | -@ |
| | * / % |
| | + - |
| | << >> |
| | & |
| | \| ^ |
| | > >= < <= |
| | <=> == === != =~ !~ |
| | && |
| | \|\| |
| | .. ... |
| | ?: |
| | = |
| | not |
| Low | and or |