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: available_set.rb
    path of file: ./repos/ruby-packer/ruby/lib/rubygems
    
    the code of the file until where you have to start completion: # frozen_string_literal: true
class Gem::AvailableSet

  include Enumerable

  Tuple = Struct.new(:spec, :source)

  attr_accessor :remote # :nodoc:

  def initialize
    @set = []
    @sorted = nil
    @remote = true
  end

  attr_reader :set

  def add
    
  def remove_installed!(dep)
    @set.reject! do |t|
      # already locally installed
      Gem::Specification.any? do |installed_spec|
        dep.name == installed_spec.name and
          dep.requirement.satisfied_by? installed_spec.version
      end
    end

    @sorted = nil
    self
  end