Predefined Global Constants
TRUE, FALSE, and
NIL are backward-compatible. It’s preferable
to use true, false, and
nil.
TRUESynonym for
true.FALSESynonym for
false.NILSynonym for
nil.ARGFAn object providing access to virtual concatenation of files passed as command-line arguments or standard input if there are no command-line arguments. A synonym for
$<.ARGVAn array containing the command-line arguments passed to the program. A synonym for
$*.DATAAn input stream for reading the lines of code following the __
END__ directive. Not defined if __END__ isn’t present in code.ENVA hash-like object containing the program’s environment variables.
ENVcan be handled as a hash.RUBY_PLATFORMA string indicating the platform of the Ruby interpreter, e.g.,
i686-linux.RUBY_RELEASE_DATEA string indicating the release date of the Ruby interpreter, e.g.,
2001-09-19.RUBY_VERSIONA string indicating the version of the Ruby interpreter, e.g.,
1.6.5.STDERRStandard error output stream. Default value of
$stderr.STDINStandard input stream. Default value of
$stdin.STDOUTStandard output stream. Default value of
$stdout.TOPLEVEL_BINDINGA
Bindingobject at Ruby’s top level.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access