instead of self.class == Array use self.kind_of?(Array)