
class Hash

  def update_keys
    each{ |k,v| delete(k) ; store( yield(k), v ) }
  end

end


#  _____         _
# |_   _|__  ___| |_
#   | |/ _ \/ __| __|
#   | |  __/\__ \ |_
#   |_|\___||___/\__|
#
=begin test

  require 'test/unit'

  class TCHash < Test::Unit::TestCase

    def test_001
      h = { 'A' => 1, 'B' => 2 }
      h.update_keys{ |k| k.downcase }
      assert_equal( { 'a' => 1, 'b' => 2 }, h)
    end

  end

=end
