Image Source:www.flickr.com

Classes, attributes, methods, and objects are the core of any Object-Oriented language. I am going to discuss how these classes, attributes, methods etc can be implemented in Ruby. There are two types of classes ‘close-ended’ and ‘open-ended’. If a class is close-ended, then new functionalities cannot be added to it without inheriting the class.
If a class is open-ended, then new functionalities can be added to it without inheriting it. Ruby is open-ended.
The class declared and defined just now is an empty class as it doesn’t contain any attributes or methods. You will notice that the procedure to define methods in ruby is very simple. def is the keyword used to define methods.
In ruby we don`t use brackets to define a set of code and we don`t use any semicolon at the end of the statements.