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: canvas.rb
    path of file: ./repos/hexapdf/lib/hexapdf/content
    
    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
    
      def rectangle(x, y, width, height, radius: 0)
        raise_unless_at_page_description_level_or_in_path
        if radius == 0
          invoke(:re, x, y, width, height)
          @current_point[0] = @start_point[0] = x
          @current_point[1] = @start_point[1] = y
          self
        else
          polygon(x, y, x + width, y, x + width, y + height, x, y + height, radius: radius)
        end