Issue #3131 has been updated by Suraj Kurapati.


Hi Matz,

To avoid delaying this request forever due to unnecessary features,
I have narrowed the requirements for Kernel#Hash() to the following:

Hash() must convert (1) nil, (2) Hash, and (3) empty Array into Hash.

    module Kernel
      def Hash(value)
        if value.respond_to? :to_hash
          value.to_hash
        elsif value.nil? or Array(value).empty?
          {}
        else
          raise ArgumentError, "invalid value for Hash: #{value}"
        end
      end
    end

Thanks for your consideration.
----------------------------------------
http://redmine.ruby-lang.org/issues/show/3131

----------------------------------------
http://redmine.ruby-lang.org