Classes and Variables, General Question

ruby

#1

Hey CA forum,
I am going through the last two units in Ruby Programming Track. With that said, I am a bit confused as to why do you use variables in the methods of classes? For example below in this code,

class Computer
def method
@name = name
end
end

what is the point of that variable? Why declare that variable?


#2

I think you could set that equal to a user's input, keeping their name or some other name.