7. Instantiation Nation. Password exceptions


#1




I have an error if I try to use in password next combination of two symbols "#$"

(ruby):18: syntax error, unexpected $end, expecting ')'

Is it issue with web ruby interpritation on codecademy or some deeper issue in Ruby?

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 "File #{filename} has been created by #{@username} at #{time}"
    end
    def Computer.get_users
        return @@users
    end
end

my_computer = Computer.new("Alex", "#$")


#2

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