Re:What I didn't know about Ruby Classes
by dragonwriter on Sunday November 22, 2020 @12:03AM
(#25175071)
> Classes are constants
No, classes are objects.
The class declaration syntax assigns the class it creates to the constant given as the name, but it's quite possible to create a class without assigning it to a constant (e.g., via Class.new).
No, classes are objects.
The class declaration syntax assigns the class it creates to the constant given as the name, but it's quite possible to create a class without assigning it to a constant (e.g., via Class.new).