开发者

Hash#key for 1.8.6

开发者 https://www.devze.com 2022-12-31 13:58 出处:网络
Greetings, I am trying to make my 1.9.1 source 1.8.6 compatible. I recognized that the开发者_如何学Gore\'s no Hash#key method. Any idea or method how to solve that?

Greetings,

I am trying to make my 1.9.1 source 1.8.6 compatible. I recognized that the开发者_如何学Gore's no Hash#key method. Any idea or method how to solve that?

Thanks!

Tobias


Use Hash#index, or require "backports/1.9.1/hash/key".

You can also require 'backports' and most of the API changes from 1.8.6 to 1.9.2 will be backported and available in Ruby 1.8.6 (including Hash#key, of course).


In ruby 1.8 that method is called index.

0

精彩评论

暂无评论...
验证码 换一张
取 消