RCR: Array#to_h

Shannon Fang wrote:

I am just reading the PickAxe 2e recently... According to Dave, to_h means a
representation of the object in hash, however to_hash means this object is
inherently compatible with hash, like to_i and to_int...

Right. But your reminder provokes me a solution, albiet it's a bit
tilted. Nonetheless I don't see any reason Array#to_hash can't be
defined. After all it is in effect a hash of restricted key (integers).
Even though that does't align with Enumerable#to_h, that's okay.

  class Array
    alias :to_hash :to_h

Thanks,
T.