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: target_cache_key.rb
    path of file: ./repos/CocoaPods/lib/cocoapods/installer/project_cache
    
    the code of the file until where you have to start completion: module Pod
  class Installer
    module ProjectCache
      # Uniquely identifies a Target.
      #
      class TargetCacheKey
        require 'cocoapods/target/pod_target.rb'
        require 'cocoapods/target/aggregate_target.rb'
        require 'digest'

        # @return [Sandbox] The sandbox where the Pods should be installed.
        #
        attr_reader :sandbox

        # @return [Symbol]
        #         The type of target. Either aggregate or pod target.
        #
        attr_reader :type

        # @return [Hash{String => Object}]
        #         The hash containing key-value pairs that identify the target.
        #
        attr_reader :key_hash

        # Initialize a new instance.
        #
        # @param [Sandbox] sandbox see #sandbox
        # @param [Symbol] type @see #type
        # @param [Hash{String => Object}] key_hash @see #key_hash
        #
        def initialize(sandbox, type, key_hash)
          @sandbox = sandbox
          @type = type
          @key_has
    
        def self.from_pod_target(sandbox, target_by_label, pod_target, is_local_pod: false, checkout_options: nil)
          build_settings = {}
          build_settings[pod_target.label.to_s] = Hash[pod_target.build_settings.map do |k, v|
            [k, Digest::MD5.hexdigest(v.xcconfig.to_s)]
          end]
          pod_target.test_spec_build_settings_by_config.each do |name, settings_by_config|
            build_settings[name] = Hash[settings_by_config.map { |k, v| [k, Digest::MD5.hexdigest(v.xcconfig.to_s)] }]
          end
          pod_target.app_spec_build_settings_by_config.each do |name, settings_by_config|
            build_settings[name] = Hash[settings_by_config.map { |k, v| [k, Digest::MD5.hexdigest(v.xcconfig.to_s)] }]
          end

          # find resources from upstream dependencies that will be named in the `{name}-resources.sh` script
          resource_dependencies = []
          pod_target.dependencies.each do |name|
            next unless target_by_label[name]

            upstream = target_by_label[name]

            # pod target
            resource_dependencies.append(upstream.resource_paths.values.flatten) if upstream.respond_to?(:resource_paths)

            # aggregate target
            resource_dependencies.append(upstream.resource_paths_by_config.values.flatten) if upstream.respond_to?(:resource_paths_by_config)
          end

          contents = {
            'CHECKSUM' => pod_target.root_spec.checksum,
            'SPECS' => pod_target.specs.map(&:to_s).sort_by(&:downcase),
            'BUILD_SETTINGS_CHECKSUM' => build_settings,
            'PROJECT_NAME' => pod_target.project_name,
          }
          if is_local_pod
            relative_file_paths = pod_target.all_files.map { |f| f.relative_path_from(sandbox.root).to_s }
            contents['FILES'] = relative_file_paths.sort_by(&:downcase)
          end
          contents['CHECKOUT_OPTIONS'] = checkout_options if checkout_options
          contents['RESOURCES'] = resource_dependencies.flatten.uniq.sort_by(&:downcase) if resource_dependencies.any?
          TargetCacheKey.new(sandbox, :pod_target, contents)
        end