You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: set.rb
    path of file: ./repos/artichoke/artichoke-backend/src/extn/stdlib/set/vendor
    
    the code of the file until where you have to start completion: #--
# frozen_string_literal: true

#
# set.rb - defines the Set class
#++
# Copy
    
  def do_with_enum(enum, &block) # :nodoc:
    if enum.respond_to?(:each_entry)
      enum.each_entry(&block) if block
    elsif enum.respond_to?(:each)
      enum.each(&block) if block
    else
      raise ArgumentError, 'value must be enumerable'
    end