This is stupid: Hash#select vs reject
A little consistency would be nice…
1 2 |
{1=>1, 2=>2, 3=>3}.reject {|key, value| key != 1 } # => {1=>1} {1=>1, 2=>2, 3=>3}.select {|key, value| key == 1 } # => [[1, 1]] |
A little consistency would be nice…
1 2 |
{1=>1, 2=>2, 3=>3}.reject {|key, value| key != 1 } # => {1=>1} {1=>1, 2=>2, 3=>3}.select {|key, value| key == 1 } # => [[1, 1]] |