Self, Getter and Setter methods and initialize, accessors concepts explained in Ruby

While I was reviewing some concepts in Ruby, I thought it would be nice to make an article about some of main concepts. I will be touching basic concepts of Ruby. However, they are crucial topics.


Self is a keyword in Ruby representing the default object of the current context.

So, in picture 1, we have a class method Drink, this Drink class have a method called show_yourself in line 15. and in picture 2, we have 2 instance of this Drink class. one martini, the other mach.