What is the difference between :method and :"method$##11" symbol?
Is :"method$##11"
format used when special characters comes in开发者_运维知识库side the symbol?
Yes, if your symbol name contains anything other than letters/numbers/underscores, you can quote it instead and it'll still be a symbol (otherwise you will get syntax errors when you don't use the quotes).
Also, using the same name quoted vs unquoted will be treated as the same symbol:
:test == :test2
# => false
:test == "test"
# => false
:test == :"test"
# => true
:test.object_id
# => 144328
:"test".object_id
# => 144328
精彩评论