lib/2DArray.rb in 2DArray-0.1.2 vs lib/2DArray.rb in 2DArray-0.1.3

- old
+ new

@@ -1,7 +1,7 @@ class Array2D def initialize(rows, cols, default=nil) - @stuff = Array.new(rows, []) {Array.new(cols, nil)} + @stuff = Array.new(rows, []) {Array.new(cols, default)} end # Redefined Object#method_missing as to forward the undefined # method to +@stuff+, an array. You can even pass blocks, too, # otherwise this would be pretty useless... \ No newline at end of file