Newbie question

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.

On Nov 22, 11:55 am, cmic [email protected] wrote:

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