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: adapter_builder.rb
    path of file: ./repos/isolator/lib/isolator
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

require "isolator/adapters/base"

module Isolator
  # Builds adapter from provided params
  module AdapterBuilder
    class << self
      def call(target: nil, method_name: nil, **options)
        adapter = Module.new do
          extend Isolator::Adapters::Base

          self.exception_class = options[:exception_class] if options.key?(:exception_class)
          self.exception_message = options[:exception_message] if options.key?(:exception_message)
          self
    
      def call(target: nil, method_name: nil, **options)
        adapter = Module.new do
          extend Isolator::Adapters::Base

          self.exception_class = options[:exception_class] if options.key?(:exception_class)
          self.exception_message = options[:exception_message] if options.key?(:exception_message)
          self.details_message = options[:details_message] if options.key?(:details_message)
        end

        mod = build_mod(method_name, adapter)
        if target && mod
          target.prepend(mod)
          adapter.define_singleton_method(:restore) do
            mod.remove_method(method_name)
          end
        end