On 09.12.11 13:01, Manav Gupta wrote:
> @x = 'Hello world'
>
> def printMe
>     puts @x
> end
>
> int the above code section when a call printMe method it behaves as
> expected. However if I remove the '@' symbol making x as a local
> variable it throws an undefined name error. which is also as expected.
> But can anyone explain me in the previous case, what is the class for
> @x.
>
> Please explain me in details

Why does it (again) sound like a school assignment?

http://ruby.runpaint.org/methods#global

kaspar