rails/rails — pull request #16711 by jeremywrowe (2014-08-27 03:01:35+00:00)
Title: adds hash#reject_values

This adds a new core_ext function to Hash; reject_values. It rejects (removes) each key / value from a hash given the block evaluates truthy. EG:

```ruby
hash = Hash[(:a..:z).zip(1..26)]
# => {:a=>1, :b=>2, :c=>3, :d=>4, :e=>5, :f=>6, :g=>7, :h=>8, :i=>9, :j=>10, :k=>11, :l=>12, :m=>13, :n=>14, :o=>15, :p=>16, :q=>17, :r=>18, :s=>19, :t=>20, :u=>21, :v=>22, :w=>23, :x=>24, :y=>25, :z=>26}

hash.reject_values(&:even?)
# => {:a=>1, :c=>3, :e=>5, :g=>7, :i=>9, :k=>11, :m=>13, :o=>15, :q=>17, :s=>19, :u=>21, :w=>23, :y=>25}
```

I think this fits in nicely with the newly added `transform_values` hash method. I noticed that most key methods are located in `./lib/active_support/core_ext/hash/keys.rb` would it be worth moving value related methods into `./lib/active_support/core_ext/hash/values.rb` sometime in the future?