【发布时间】:2013-05-23 20:35:13
【问题描述】:
{"table_no"=>nil, "name"=>"Kelly Shaye Gan", "account_id"=>1}
我的意思是我确定有;只是花了几个小时试图弄清楚。我认为答案就在这里:Most efficient way to map a specific string into a hash in Ruby,但我不是正则表达式方面的专家,所以我不确定要在扫描中插入哪个表达式。
【问题讨论】:
-
我认为需要问的问题是:为什么你首先要有那个字符串?
eval的解决方案通常表明存在设计缺陷。