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: pdf.rb
    path of file: ./repos/hexapdf/lib/hexapdf/image_loader
    
    the code of the file until where you have to start completion: # -*- encoding: utf-8; frozen_string_literal: true -*-
#
#--
# This file is part of HexaPDF.
#
# HexaPDF - A Versatile PDF Creation and Manipulation Library For Ruby
# Copyright (C) 2014-2024 Thomas Leitner
#
# HexaPDF is free software: you 
    
      def self.load(document, file_or_io)
        idoc = if file_or_io.kind_of?(String) && document.config['image_loader.pdf.use_stringio']
                 HexaPDF::Document.open(file_or_io)
               elsif file_or_io.kind_of?(String)
                 HexaPDF::Document.new(io: File.open(file_or_io, 'rb'))
               else
                 HexaPDF::Document.new(io: file_or_io)
               end
        form = idoc.pages[0].to_form_xobject
        document.add(document.import(form))
      end