[Ruby] Ruby Symbol

http://www.troubleshooters.com/codecorn/ruby/symbols.htm 

Ruby 里的Symbol概念的讲解,

What are symbols?

It's a string. No it's an object. No it's a name.

puts  :Steve.class  # output : Symbol Class

 Symbol can not change at runtime 

What can symbols do for you?

A symbol is a way to pass string information, always assuming that:

    1. The string needn't be changed at runtime.
    2. The string doesn't need methods of class String.
原文地址:https://www.cnblogs.com/buhaiqing/p/3059717.html