| | |
Names starting with ":"
Please support our Ruby advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
•
•
What are names starting with the ":", are they variables, constants or something else?
drjay
ruby Syntax (Toggle Plain Text)
% irb --simple-prompt >> a = :something => :something >> a.class => Symbol
Then look it up in the docs: http://www.ruby-doc.org/core/classes/Symbol.html
Last edited by pty; Jun 5th, 2009 at 4:00 pm.
Note to self... pocket cup
•
•
Join Date: Jun 2008
Posts: 1
Reputation:
Solved Threads: 0
names starting with ":" are expressions that return a symbol object e.g.
The construct :name is an expression that returns a symbol corresponding to name.
Ruby Syntax (Toggle Plain Text)
Class Person attr_reader :name, :age, :sex end me = Person.new("poison", "24", "male")
The construct :name is an expression that returns a symbol corresponding to name.
![]() |
Similar Threads
- Starting " C " (C)
- MySQL Migr Toolkit, Generic JDBC ".. schema names could not be retrieved (error: 0)." (MySQL)
- Hidden program installs .dlls with randomly generated names in random "notify" reg. (Viruses, Spyware and other Nasties)
- popen and "ls" (C)
- google "keyword" question (Search Engine Optimization)
- hotmail not showing "from" in inbox (Web Browsers)
Other Threads in the Ruby Forum
- Previous Thread: Starting up with Ruby on Rails..
- Next Thread: HOW TO send SMS using ruby on rails
| Thread Tools | Search this Thread |






