Course Content

Course Content


The first thing you should know about Ruby is that there are no class methods. What we commonly refer to as a "class method" is simply a regular singleton method. Singleton methods can be found on any object; classes aren't required.

In Ruby, a method is a collection of expressions that returns a value. You can structure your code within a method into subroutines that can be conveniently called from other parts of the application.

In object-oriented programming, a class is used to describe one or more objects. It's used to create or instantiate certain objects within a program. While each object is made up of a single class, that same class can be utilized to make many objects.

Instance methods require a class instance and have access to it via self. A class instance is not required for class methods. They can't get to the instance (self), but they can get to the class using the cls command.

Share With Friend

Have a friend to whom you would want to share this course?

Download LearnVern App

App Preview Image
App QR Code Image
Code Scan or Download the app
Google Play Store
Apple App Store
598K+ Downloads
App Download Section Circle 1
4.57 Avg. Ratings
App Download Section Circle 2
15K+ Reviews
App Download Section Circle 3
  • Learn anywhere on the go
  • Get regular updates about your enrolled or new courses
  • Share content with your friends
  • Evaluate your progress through practice tests
  • No internet connection needed
  • Enroll for the webinar and join at the time of the webinar from anywhere