What kind of variable is time?


When I defined the variable time inside the method create, it doesn't use @, @@ nor $. What does it mean? Can I access that variable anytime or only inside that method or class?


If you mean something like this

def create
time = 1

Then the variable can be called upon from anywhere, and is a global variable.

EDIT: It's a local variable, my mistake.


K I don't really know any ruby, but I would claim that is local to that function, not global

It would return 1 though, since the assignment itself evaluates to 1 and it's the last line of the function/method


Whoops—I got my local and global variables mixed up.