Jon Baer wrote:
> Going through pick-axe and was just wondering if there was a one liner 
> for something such as this that I may have missed:
>
> h2 = Hash.new
> h1 = {"foo1"=>"bar1", "foo2"=>"bar2"}
> query = h1.select { |k,v| v == "bar2" }
> query.each do |result|
>   h2[result[0]] = result[1]
> end
> p h2
>
> Thanks.
>
> - Jon
>
>
Perhaps:

h2 = Hash.new
h1 = {"foo1"=>"bar1", "foo2"=>"bar2"}
h2 = h1.delete_if{|k,v| v != "bar2"}
p h2