DEV Community

Luke O'Connell
Luke O'Connell

Posted on

Today I learned

Today I learned how to define our own class. We use attr_accessor to add attributes to the class. I also learned how to define my own method using the def keyword. There are instance methods as well as class methods. We use the self keyword to refer to certain objects since we don't know the variable name in advance. Using the < notation, we can define a new class that inherits the power of a parent class.

Top comments (0)