I have a class where I was using the Array#shift instance method on an instance variable. I thought I made a \"copy\" of my instance variable but in fact I hadn
use array.map(&:dup) whenever you need to copy a 2D array
Don't use the marshalling trick unless you really want to deep copy an entire object graph. Usually you want to copy the arrays only but not the contained elements.