to_hash (PGrow)

    /*
     * call-seq:
     *   row.to_hash -> Hash
     *
     * Returns a +Hash+ of the row's values indexed by column name.
     * Equivalent to <tt>Hash [*row.keys.zip(row).flatten]</tt>
     */
    static VALUE
    pgrow_to_hash(self)
        VALUE self;
    {
        VALUE result = rb_hash_new();
        VALUE keys = pgrow_keys(self);
        int i;
        for (i = 0; i < RARRAY(self)->len; ++i) {
            rb_hash_aset(result, rb_ary_entry(keys, i), rb_ary_entry(self, i));
        }
        return result;
    }