(can you tell I'm learning Ruby today? :))
I want to determine if the multidimensional array I'm working with is a 'rectangle'--i.e., the rows are the same size. Here's what I'm doing, which works but feels clunky.
if @myArray[0].size != @myArray[[email protected]].size
raise "This array is not a rectangle."
end
Basically, I'm checking if the first array's size if equal to all the other array's size. Somehow, it seems this isn't "ruby" enough, you know? Anyone have any more elegant solutions?