Stats

276 Contributors: 19
2017-01-23
Licensed under: CC-BY-SA

Not affiliated with Stack Overflow
Rip Tutorial: info@zzzprojects.com

Download eBook

Classes

Download ruby eBook

Syntax

  • class Name
  • #some code describing the class behavior
  • end

Remarks

Class names in Ruby are Constants, so the first letter should be a capital.

class Cat # correct
end  

class dog # wrong, throws an error
end

Related Examples