# Variable scope

**URL:** <https://www.ruby-forum.com/t/variable-scope/128855>\
**Category:** Rails\
**Created:** [February 12, 2008, 5:28am UTC](https://www.ruby-forum.com/t/variable-scope/128855 "2008-02-12T05:28:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![spashokkumar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/7feea3/32.png) [@spashokkumar](https://www.ruby-forum.com/u/spashokkumar)\
**Post date:** [February 12, 2008, 5:28am UTC](https://www.ruby-forum.com/t/variable-scope/128855/1 "2008-02-12T05:28:03Z")

</div>

Can any one please tell me, what is the exact scope of the following  
variable types

variable  
@variable  
@@variable

Thanks

---

<div class="post-metadata">

**Author:** ![spashokkumar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/7feea3/32.png) [@spashokkumar](https://www.ruby-forum.com/u/spashokkumar)\
**Post date:** [February 12, 2008, 6:49am UTC](https://www.ruby-forum.com/t/variable-scope/128855/2 "2008-02-12T06:49:41Z")

</div>

> Can any one please tell me, what is the exact scope of the following  
> variable types
> 
> variable  
> @variable  
> @@variable

You are not going to learn Ruby piecemeal, by asking mailing lists to do  
your homework for you. There are many fine Ruby language tutorials out  
there; get one and read it for a while. You will soak up all sorts of  
useful  
details!

–  
Phlip  
[O'Reilly Media - Technology and Business Training](http://www.oreillynet.com/ruby/blog/2008/02/assert2.html)
