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: fragment.rb
    path of file: ./repos/padrino-framework/padrino-cache/lib/padrino-cache/helpers
    
    the code of the file until where you have to start completion: module Padrino
  module Cache
    module Helpers
      ##
      # Whereas page-level caching, described i
    
        def cache(key, opts = {}, &block)
          if settings.caching?
            began_at = Time.now
            if settings.cache.key?(key.to_s)
              value = settings.cache[key.to_s]
              logger.debug "GET Fragment", began_at, key.to_s if defined?(logger)
              concat_content(value.to_s.html_safe)
            else
              value = capture_html(&block)
              settings.cache.store(key.to_s, value, opts)
              logger.debug "SET Fragment", began_at, key.to_s if defined?(logger)
              concat_content(value)
            end