将字符串转换为符号

鉴于 String:

s = "something"

有几种方法可以将它转换为 Symbol:

s.to_sym
# => :something
:"#{s}"
# => :something