Ruby LanguageClasses

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