def |(other)
      if !other.is_a?(Directory)
        raise ArgumentError, "#{other} is not a Directory"
      end

      dup.tap do |directory|
        other.files.each do |file|
          directory.add_file(file.dup)
        end

        other.directories.each do |new_directory|
          existing_directory = @directories[new_directory.name]

          if existing_directory.nil?
            directory.add_directory(new_directory.dup)
          else
            directory.add_directory(new_directory | existing_directory)
          end
        end
      end
    end
def |(other)
      if !other.is_a?(Directory)
        raise ArgumentError, "#{other} is not a Directory"
      end

      dup.tap do |directory|
        other.files.each do |file|
          directory.add_file(file.dup)
        end

        other.directories.each do |new_directory|
          existing_directory = @directories[new_directory.name]

          if existing_directory.nil?
            directory.add_directory(new_directory.dup)
          else
            directory.add_directory(new_directory | existing_directory)
          end
        end
      end
    end
Computes the union of this +Directory+ with another +Directory+. If the
 two directories have a file path in common, the file in the +other+
 +Directory+ takes precedence. If the two directories have a sub-directory
 path in common, the union's sub-directory path will be the union of those
 two sub-directories.

 @raise [ArgumentError] if the +other+ parameter is not a +Directory+

 @param other [Directory]

 @return [Directory]