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

module Jekyll
  module GitHubMetadata
    module Sanitizer
      extend self
      # Sanitize an object.
      # When the resource is either `false`, `true`, `nil` or a number,
      #   it returns the resource as-is. When the resource is an array,
      #   it maps over the entire array, sanitizing each of its values.
      #   When the resource responds to the #to_hash method, it retu
    
      def sanitize(resource)
        case resource
        when Array
          resource.map { |item| sanitize(item) }
        when Numeric, Time
          resource
        when FalseClass
          false
        when TrueClass
          true
        when NilClass
          nil
        when String
          resource
        when Value
          resource.render
        else
          if resource.respond_to?(:to_hash)
            sanitize_resource(resource)
          else
            resource.to_s
          end