Lesson 3 Why this is also not passing


#1

Below is my codeclass Computer
@@users = {}
def initialize(username, password)
@username = username
@password = password
@files = {}
end
Rajesh
coder 68873


#2

Are there any error messages? They may be telling you what the problem is. If there are any, then you should include them and any other information so that those reading your question has access to the same information as you.

You are missing an end

If there's an error like:

syntax error, unexpected $end, expecting keyword_end

Then read it carefully, see how it says that you're missing an end keyword?


#3

I got the same problem. No error messages only: nil
But it says: Oops, try again. Did you pass two arguments, 'username' and 'password', to your initalize method?

My code:

class Computer
end
def initialize(username, password)
@username = username
@password = password
@files = {}
end


#4

Very strange but the code does work in the next lesson. Only on lesson 3 is doesn't give the green light.


#5

Wouldn't you want your initialize to be inside the class?


#6

Oh wow :open_mouth: That was a pretty stupid mistake. Thanks ionatan!