[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Variables starting with ":"

Eduardo Scoz

1/9/2007 9:21:00 PM

Hi guys,

I've been looking for information about this for a while on some ruby
books, and tutorials, but could never find anything.

What's the diference between regular variables defined as, lets say
"example", and the ones defined as ":example" ? If there's a difference,
when should each case be used?

In many examples, it's common to see code that uses variables with the
:, specially when defining arrays (like cookies[:user_id] = "abc")..

I'm sorry for the simple/stupid question.. I've been studying about ruby
only for the last week or so.

Thanks a lot!!

Eduardo

--
Posted via http://www.ruby-....