Virtual Computer 5: Getting More Creative


#1

Here's a copy of my code, and I'm staring at it, and totally blind as to what speckle is off. I keep getting the error message: "Did you add a create method to your Computer class? " What am I doing wrong? Any help would be awesome, thanks!

class Computer
    @@users = {}
    
    def initialize (username, password)
        @username = username
        @password = password
        @files = ()
        @@users[username] = password
    end
    
    def create (filename)
        time = Time.now
        @files[filename] = time
        puts "You just created a new file, #{filename} at #{time}!"
    end    
end

#2

use brackets instead of parentheses,

to,

@files = {}


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.