An existing Ruby class is never closed. You can constantly add methods to an existing class. This applies to all classes.
This can be done on classes you defined, but also on standard classes. Meaning you can add functionality to existing Ruby classes also.
Related Course: Learn Ruby On Rails For Web Development
First define a class and create an object.
How? Open up a class definition for an existing class, add the new content.
The class is not redefined here. Instead it’s reopened, and the method is attached to it.
You can also overwrite an existing method. The latest method will always be the one used.
Using Ruby open classes can create strange bugs. In general you should always update the existing classes.