Code passes but doesn't work [Virtual Computer]


#1



https://www.codecademy.com/courses/ruby-beginner-en-X5wcR/0/8?curriculum_id=5059f8619189a5000201fbcb


I followed all the instructions for this exercise and it makes sense to me. However, when I try to actually call a method from the instance I made, I get an error:

undefined local variable or method `username' for #0x00000001391b50>

Did I miss something? This is really getting on my nerves...


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

my_computer = Computer.new("user22", "somepassword")
my_computer.create("document.txt")


#2

Hi this line

puts "#{filename} was created by #{username} at #{time}."

it's missing the @ to username


#3

I feel like an idiot now...thanks!