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.
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:
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs