Classes
suggest changeVersions
The notes below were written with Ruby 1.8–2.3 in mind. Class syntax is unchanged.
Syntax
class Name
# some code describing the class behavior
end
Remarks
Class names in Ruby are constants, so they must start with an uppercase letter.
class Cat # correct
end
class dog # wrong, throws an error
end
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents