A basic class consists only of the class keyword and the name of the class. Check it out:

class NewClass # Class magic here end

Our NewClass has the ability to create new Ruby objects of class NewClass (just like "Hello!" is a String and 4 is a Fixnum). By convention, class names start with a capital letter and use CamelCase instead of relying_on_underscores.



Create a class called Person in the editor. Don’t put anything between class Person and end just yet.

Take this course for free

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Or sign up using:

Already have an account?