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

module Asciidoctor::PDF::FormattedT
    
    def render_behind fragment
      document = fragment.document
      text = fragment.text
      x = fragment.left
      y = fragment.baseline
      align = (format_state = fragment.format_state)[:align]
      if align == :center || align == :right
        gap_width = (format_state.key? :width) ?
          fragment.width - (document.width_of text) :
          (format_state[:border_offset] || 0) * 2
        x += gap_width * (align == :center ? 0.5 : 1) if gap_width > 0
      end