Let's add a method so that we
can ask car1, in which direction
is it currently going.
The method name will be current_direction
.
Here, we run into the same issue.
Method current_direction
cannot access
variable direction of method turn.
We want turn method to
store the direction
in an instance variable so that
current_direction can
access that instance variable.
If we add @
to a variable,
then that variable becomes
instance variable
.
The special thing about an
instance variable is that any
instance method can access an
instance variable.
In this case, we are going
to store the direction of
the turn into an instance variable.