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: resource_list.rb
    path of file: ./repos/chef/lib/chef/resource_collection
    
    the code of the file until where you have to start completion: #
# Author:: Tyler Bal
    
      def delete(key)
        raise ArgumentError, "Must pass a Chef::Resource or String to delete" unless key.is_a?(String) || key.is_a?(Chef::Resource)

        key = key.to_s
        ret = @resources.reject! { |r| r.to_s == key }
        if ret.nil?
          raise Chef::Exceptions::ResourceNotFound, "Cannot find a resource matching #{key} (did you define it first?)"
        end