RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

Yet another look at Ruby symbols

Here is a detailed look at the mysterious Ruby Symbols.

Comments

Thanks! I was recently thinking that I take symbols for granted and needed to dig a little deeper.

Hah, Symbol.to_sym. At first I thought that was just an inherited method, but Symbol.instance_methods(false) indicates that it’s defined explicitly for the Symbol class… Anybody have any insight as to why?

Side note to Peter C.: the code block does not appear to be working.

duwanis: I would guess that it is so that you can call to_sym on a Symbol without worrying about it complain that the method doesn’t exist…the whole duck-typing thing. :-)

I think it’s because of the CSS reset I’m using. I’ll need to redefine what CODE means ;-) Thanks!

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in