ndim-methods function

Extract the number of dimensions of an object