Defining Classes
This lesson will teach you how to define your own classes in Ruby!
Let’s start by creating a class Calculator, and adding some methods to it,
step by step.
In Ruby, you define a class like this:
That’s all. It’s not a very useful class since it’s completely empty, but it’s a class.
💡 ...
Create a free account to access the full course.
By signing up, you agree to Educative's Terms of Service and Privacy Policy