Created
June 18, 2013 21:27
-
-
Save mattmawhinney/5809589 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Code from Codeacademy working on using class variables and class methods | |
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 "#{filename} was created by #{@username} at #{time}." | |
end | |
def Computer.get_users | |
@@users | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment