January 2024
Intermediate to advanced
718 pages
20h 15m
English
A Ruby class definition creates or extends an object of class Class by executing the code in body. In the first form, a named class is created or extended. The resulting Class object is assigned to a constant named classname (keep reading for scoping rules). This name should start with an uppercase letter. In the second form, an anonymous (singleton) class is associated with the specific object.
If present, superexpr should be an expression that evaluates to a Class object that will be the superclass of the class being defined. If omitted, the superclass defaults to class Object.
Within body, most Ruby expressions are executed as the definition ...
Read now
Unlock full access