self in Ruby?

self represents the current object.

Inside a class → self refers to the object calling the method.

For class methods → self refers to the class itself.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *