Creating a class

suggest change

You can define a new class using the class keyword.

class MyClass
end

Once defined, you can create a new instance using the .new method

somevar = MyClass.new
# => #<MyClass:0x007fe2b8aa4a18>

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents