Issue #6118 has been updated by ssuda (Sambasiva Suda).

File 000_ruby_hash_keys_of.patch added

Here is the updated patch
----------------------------------------
Feature #6118: Hash#keys_of(values), returns related keys of given values
https://bugs.ruby-lang.org/issues/6118#change-25196

Author: naruse (Yui NARUSE)
Status: Open
Priority: Normal
Assignee: 
Category: 
Target version: 


Hash#key(value) ?????????????????????????

{a: 1, b: 2, c: 3, d: 1}.key(1)
=> :a
?????????????????????????????????
{a: 1, b: 2, c: 3, d: 1}.keys_of(1)
=> [:a, :d]
?????????????????????????????????

Ruby ?????????以???????????????????????????
????????????????????

class Hash
  def keys_of(*a)
    each_with_object([]) {|(k, v), r| r << k if a.include? v}
  end
end


-- 
http://bugs.ruby-lang.org/