Ruby Symbols vs Strings in Hashes

前端 未结 3 499
甜味超标
甜味超标 2020-12-31 08:19

I have this hash:

{
  \"title\"=>\"Navy to place breath-test machines on all its ships\", 
  \"url\"=>\"http://feeds.washingtonpost.com/click.phdo?i=a6         


        
3条回答
  •  甜味超标
    2020-12-31 08:31

    Why?---Because :url and 'url' are different, i.e., :url != 'url'.

    Shouldn't it work with either?---No.

提交回复
热议问题