On Nov 28, 1:47 pm, Andrew Stone <stoneli... / gmail.com> wrote:
> Note:  parts of this message were removed by the gateway to make it a legal Usenet post.
>
> Hello all,
>
> Was just wondering if there was something simple like:
>
> hash.clear("value")
>
> This would remove all entries from the hash whose value == "value".
>
> Yeah, I know about delete_if, this would just be more succinct.  I can be
> lazy sometimes.
>
> thanks,
> andy
>
> --
> Andrew Stone

You can always wrap delete_if...

class Hash
  def remove(target)
    self.delete_if { | key, value |
      value == target
    }
  end
end

Regards,
Jordan