Name
Class Variables
Synopsis
@@foo
Class variables begin with
@@
and must be initialized before they can be used
in method definitions. Referencing an uninitialized class variable
produces an error. Class variables are shared among descendants of
the class or module in which the class variables are defined.
Overriding class variables produce warnings with the
-w
option.
Get Ruby in a Nutshell 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.