Let’s go ahead and toss in a class variable. We’ll use the variable @@users to keep track of all the users on our computer.



Add a class variable called @@users to your Computer class. Set it equal to an empty hash.

In your initialize method, set @@users[username] = password so that your @@users hash keeps usernames as keys with each username’s password as the associated value.

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?