mirror of
https://github.com/clearlinux/dockerfiles.git
synced 2026-04-28 19:13:48 +00:00
28 lines
551 B
Ruby
28 lines
551 B
Ruby
class Machine
|
|
@@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 Machine.get_users
|
|
@@users
|
|
end
|
|
end
|
|
|
|
my_machine = Machine.new("eric", 01234)
|
|
your_machine = Machine.new("you", 56789)
|
|
|
|
my_machine.create("groceries.txt")
|
|
your_machine.create("todo.txt")
|
|
|
|
puts "Users: #{Machine.get_users}" |