Instantaion Nation


#1

I have to be missing something stupid since I keep getting the error "undefined method `[]=' for nil:NilClass"
I can't see anything wrong with any of the methods though.

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

my_computer = Computer.new("Name", 9455)

#2

Nevermind, I forgot the second @ in @users[username] = password