The following keywords are used by Ruby.
The script encoding of the current file. See Encoding
.
The line number of this keyword in the current file.
The path to the current file.
Runs before any other code in the current file. See miscellaneous syntax
Runs after any other code in the current file. See miscellaneous syntax
Creates an alias between two methods (and other things). See modules and classes syntax
Short-circuit Boolean and with lower precedence than &&
Starts an exception handling block. See exceptions syntax
Leaves a block early. See control expressions syntax
Starts a case
expression. See control expressions syntax
Creates or opens a class. See modules and classes syntax
Defines a method. See methods syntax
Returns a string describing its argument. See miscellaneous syntax
Starts a block.
The unhandled condition in case
, if
and unless
expressions. See control expressions
An alternate condition for an if
expression. See control expressions
The end of a syntax block. Used by classes, modules, methods, exception handling and control expressions.
Starts a section of code that is always run when an exception is raised. See exception handling
Boolean false. See literals
A loop that is similar to using the each
method. See control expressions
Used for if
and modifier if
statements. See control expressions
Used to separate the iterable object and iterator variable in a for
loop. See control expressions It also serves as a pattern in a case
expression. See pattern matching
Creates or opens a module. See modules and classes syntax
Skips the rest of the block. See control expressions
A false value usually indicating “no value” or “unknown”. See literals
Inverts the following boolean expression. Has a lower precedence than !
Boolean or with lower precedence than ||
Restarts execution in the current block. See control expressions
Starts an exception section of code in a begin
block. See exception handling
Retries an exception block. See exception handling
Exits a method. See methods. If met in top-level scope, immediately stops interpretation of the current file.
The object the current method is attached to. See methods
Calls the current method in a superclass. See methods
Indicates the end of conditional blocks in control structures. See control expressions
Boolean true. See literals
Prevents a class or module from responding to a method call. See modules and classes
Used for unless
and modifier unless
statements. See control expressions
Creates a loop that executes until the condition is true. See control expressions
A condition in a case
expression. See control expressions
Creates a loop that executes while the condition is true. See control expressions
Starts execution of the block sent to the current method. See methods
Ruby Core © 1993–2020 Yukihiro Matsumoto
Licensed under the Ruby License.
Ruby Standard Library © contributors
Licensed under their own licenses.