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

require "digest"

module Jekyll
  class Cache
    # class-wide base cache
    @base_cache = {}

    # class-wide directive to write cache to disk is enabled by defaul
    
    def []=(key, value)
      @cache[key] = value
      return unless disk_cache_enabled?

      path = path_to(hash(key))
      value = new Hash(value) if value.is_a?(Hash) && !value.default.nil?
      dump(path, value)
    rescue TypeError
      Jekyll.logger.debug "Cache:", "Cannot dump object #{key}"
    end