Ruby-extension for multi-dimensional and uniform arrays