Pseudovariables
Table 4 shows Ruby’s pseudovariables. A pseudovariable is an object that looks like a variable, acts like a constant, and can’t be assigned a value. These are also listed in Table 1.
Table 4. Pseudovariables in Ruby
Pseudovariable | Description |
---|---|
| Logical or Boolean |
| Empty, uninitialized, or invalid; always |
| Current object (receiver invoked by a method). |
| Logical or Boolean |
| Name of current source file. |
| Number of current line in the current source file. |
Get Ruby Pocket Reference now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.