newbie question

C

cmic

Hello

I noticed the following example somewhere

def mymethod(opts)
p opts
end
mymethod:)aaa => "something")

I'm wondering what this :aaa stands for. If I omit the
colon before the dummy aaa, it doesn't works.

Thanks for any hint/light.
 
L

Luis Lavena

Hello

I noticed the following example somewhere

def mymethod(opts)
p opts
end
mymethod:)aaa => "something")

I'm wondering what this :aaa stands for. If I omit the
colon before the dummy aaa, it doesn't works.

Is because 'aaa' is undefined, while :aaa is a symbol

Get a free PDF version of The Book of Ruby to learn more about Ruby
syntax:

http://www.sapphiresteel.com/The-Book-Of-Ruby
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,164
Messages
2,570,898
Members
47,439
Latest member
shasuze

Latest Threads

Top