6. Who are the users (Class Method)


#1

The code seems to pass yet I still get this error message: "Oops, try again. Did you add a get_users method to your Computer class?"

Here is my code:

class Computer
    @@users = {}
    def initialize(username, password)
        @username
        @password
        @files = files.Hash
        @@users[username] = password
    end
    def create(filename)
        time = Time.now
        @files[filename] = time
        puts "#{username} created #{filename} at #{time}."
    end
    def Computer.get_user
        return @@users
    end
end

Any suggestions?


#2

get_users
get_user

It's also created differently from the other methods, but I don't know what it's supposed to look like


#3

Wow, missed the "s" on users. What a simple mistake. Thanks!


#4

Your method name is missing an s at the end. .get_users. Since the method is so simple, only one line, we can use the implicit return:

    def Computer.get_users
        @@users
    end

#5

Spend three times as much time tracking down lessons as I do writing answers. What a pain. Wish members would post a link with their questions. It would make life so much easier for everyone, and get them the help they need much faster.