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

module CableReady
  class OperationBuilder
    include Identifiable
    attr_reader :identifier, :previous_selector, :previous_xpath

    def self.finalizer_for(identifier)
      proc {
        channel = CableReady.config.observers.find { |o| o.try(:identifier) == identifier }
        CableReady.config.delet
    
    def add_operation_method(name)
      return if respond_to?(name)
      singleton_class.public_send :define_method, name, ->(*args) {
        if args.one? && args.first.respond_to?(:to_operation_options) && [Array, Hash].include?(args.first.to_operation_options.class)
          case args.first.to_operation_options
          when Array
            selector, options = nil, args.first.to_operation_options
              .select { |e| e.is_a?(Symbol) && args.first.respond_to?("to_#{e}".to_sym) }
              .each_with_object({}) { |option, memo| memo[option.to_s] = args.first.send("to_#{option}".to_sym) }
          when Hash
            selector, options = nil, args.first.to_operation_options
          else
            raise TypeError, ":to_operation_options returned an #{args.first.to_operation_options.class.name}. Must be an Array or Hash."
          end