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

module Rails
  module GraphQL
    # = Rails GraphQL Callback
    #
    # An extra powerful proc that can handle way more situations than the
    # original block caller
    class Callback
      EXCLUSIVE_ARGUMENT = :exclusive_callback

      attr_reader :event_name, :block, :target, :filters

      delegate :event_filters, to: :target
      delegate :callback_inject_arguments, :callback_inject_named_arguments,
        t
    
        def owner
          @owner ||= target.all_owners.find do |item|
            item.is_a?(Class) && item.included_modules.include?(Helpers::Instantiable) &&
              item.method_defined?(block)
          end || target
        end

        # Using the filters, check if the current callback can be executed
        def can_run?(event)
          return false if exclusive? && !event.same_source?(target)

          filters.all? do |key, options|
            target.instance_exec(options, event, &event_filters[key])
          end
        end

        # Call the callback block as a symbol
        # TODO: Maybe block calling non-public events
        # TODO: This is the only reason why directives needs an owner
        def call_symbol(event, *args, **xargs)
          event.on_instance(owner) do |instance|
            block = instance.method(@block)
            args, xargs = collect_parameters(event, [args, xargs], block)
            block.call(*args, **xargs)
          end
        end

        # Call the callback block as a proc
        def call_proc(event, context = nil, *args, **xargs)
          args, xargs = collect_parameters(event, [args, xargs])
          args << event unless inject_arguments? || (block.arity - 1) == args.size
          (context || event).instance_exec(*args, **xargs, &block)
        end

        # Read the arguments needed for a block then collect them from the
        # event and return the execution args
        def collect_parameters(event, send_args, block = @block)
          args_source = event.send(:args_source)
          send_args[0] += @pre_args.deep_dup
          send_args[1].merge!(@pre_xargs.deep_dup)
          return send_args unless inject_arguments?

          # TODO: Maybe we need to turn procs into lambdas so the optional
          # arguments doesn't suffer any kind of change
          idx = -1
          block.parameters.each_with_object(send_args) do |(type, name), result|
            case type
            when :opt, :req
              idx += 1
              next unless callback_inject_arguments
              result[0][idx] ||= event.parameter(name) if event.parameter?(name)
            when :keyreq
              next unless callback_inject_named_arguments
              result[1][name] ||= args_source[name]
            when :key
              next unless callback_inject_named_arguments
              result[1][name] ||= args_source[name] if args_source.key?(name)
            end
          end
        end

        # Check if the callback should inject arguments
        def inject_arguments?
          callback_inject_arguments || callback_inject_named_arguments
        end
    end