6. Who're the users?


#1

Cannot figure out what I am doing wrong?

instructions
Add a new class method to your Computer class called Computer.get_users. It should have no parameters.Your new Computer.get_users method should return the @@users class variable.

class Computer
@@users = {}
def initialize(username, password)
@username = username 
@password = password
@files = {}
@@users[username] = password
def create(filename)
time = Time.now
@files[filename] = time
puts "file was created"
def Computer.get_users
@@users
end
end
end
end

#2

You're defining your methods inside other methods. Just define them next to each other inside the class.


#3

I am a complete noob....other than what I have acquired here. I do not understand. I followed the syntax given, but still seem to be missing something. I do not want to skip over the lesson


#4

You're defining your methods this way:

def method1
def method2
def method3
end
end
end

which means that method3 is inside method2 and method2 is inside method1.

Define your methods next to each other instead:

def method1
end
def method2
end
def method3
end

#5

Awesome!! Thanks so much