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/origami/lib/origami/xfa
    
    the code of the file until where you have to start completion: =begin

    This file is part of Origami, PDF manipulation framework for Ruby
    Copyright (C) 2017	Guillaume Delugr√©.

    Origami is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Origami is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Lesser Gene
    
                def enclose_pdf(pdfdata)
                    require 'base64'
                    b64data = Base64.encode64(pdfdata).chomp!

                    doc = elements['document'] || add_element('document')
                    chunk = doc.elements['chunk'] || doc.add_element('chunk')

                    chunk.text = b64data

                    self
                end

                def has_enclosed_pdf?
                    chunk = elements['document/chunk']

                    not chunk.nil? and not chunk.text.nil?
                end

                def remove_enclosed_pdf
                    elements.delete('document') if has_enclosed_pdf?
                end

                def enclosed_pdf
                    return nil unless has_enclosed_pdf?

                    require 'base64'
                    Base64.decode64(elements['document/chunk'].text)
                end

            end