On Wed, Jul 15, 2009 at 2:21 AM, shusseina<[email protected]> wrote:
>
> From what I have read, in Ruby a Symbol is prefixed with a colon as
> in :my_symbol, yet I can do this...
>
>>> :my_symbol
> => :my_symbol
>>> my_variable = :my_symbol
> => :my_symbol
>>> :my_symbol.class
> => Symbol
>>> :my_symbol.object_id
> => 199218
>>> my_variable.class
> => Symbol
>>> my_variable.object_id
> => 199218
>
> Comments?

A common Ruby beginner confusion is not understanding the relationship
between objects and variables.

This article might help

http://talklikeaduck.denhaven2.com/2006/09/13/


-- 
Rick DeNatale

Blog: http://talklikeaduck.denhaven2.com/
Twitter: http://twitter.com/RickDeNatale
WWR: http://www.workingwithrails.com/person/9021-rick-denatale
LinkedIn: http://www.linkedin.com/in/rickdenatale

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to