From: "rubikitch ." Date: 2008-11-07T05:25:53+09:00 Subject: [ruby-dev:37028] [Backport #716] Hash#key Backport #716: Hash#key http://redmine.ruby-lang.org/issues/show/716 起票者: rubikitch . ステータス: Open, 優先度: Normal Ruby 1.9ではHash#indexがdeprecatedになりますが、いきなりdeprecatedになるのは混乱すると思うのでRuby 1.8にも入れておくべきだと思います。 # ruby19 result hash = {1=>"one"} hash.index "one" # => 1 # !> Hash#index is deprecated; use Hash#key hash.key "one" # => 1 # ruby18 result hash = {1=>"one"} hash.index "one" # => 1 hash.key "one" # => # ~> -:5: undefined method `key' for {1=>"one"}:Hash (NoMethodError) ---------------------------------------- http://redmine.ruby-lang.org