Hash

创建(特殊的)

Hash[]

Hash[‘a’,1,’b’,2]->yes

Hash[‘a’,1,’b’,’b’]->no

Hash[[[‘a’,1],[‘b’,2]]]->yes

 

 

 

删除

delete (有个带if的条件删除)

清除用clear

遍历

each开头的

each {| key, value | block } hshclick to toggle source

each_pair {| key, value | block } hsh

each_key {| key | block } hsh

 

 

 

 

 

 

 

 

posted @ 2015-11-18 16:09  怒杀神  阅读(141)  评论(0编辑  收藏  举报