class Computer
@@users = {}
def Computer.get_users
return @@users
end
def initialize(username, password)
@username = username
@password = password
@files = {}
@@users[username] = password
end
def create(filename)
@filename = filename
@time = Time.now
@files[filename] = @time
puts "A new file was created: #{@filename} #{@username} #{@time}"
end
end
my_computer = Computer.new("Jim", test)
No comments:
Post a Comment