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: work_package_representer.rb
    path of file: ./repos/openproject/modules/gitlab_integration/lib/open_project/gitlab_integration/patches/api
    
    the code of the file until where you have to start completion: #-- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2023 Ben Tey
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
#
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
# Copyright (C) 2006-2013 Jean-Philippe Lang
# Copyright (C) 2010-2013 the ChiliProject Team
# Copyright (C) 2012-2021 the OpenProject GmbH
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be usef
    
        def extension # rubocop:disable Metrics/AbcSize
          ->(*) do
            link :gitlab,
                 cache_if: -> { current_user.allowed_in_work_package?(:show_gitlab_content, represented) } do
              next if represented.new_record?

              {
                href: "#{work_package_path(id: represented.id)}/tabs/gitlab",
                title: "gitlab"
              }
            end

            link :gitlab_merge_requests do
              next if represented.new_record?

              {
                href: api_v3_paths.gitlab_merge_requests_by_work_package(represented.id),
                title: "Gitlab merge requests"
              }
            end

            link :gitlab_issues do
              next if represented.new_record?

              {
                href: api_v3_paths.gitlab_issues_by_work_package(represented.id),
                title: "Gitlab Issues"
              }
            end
          end
        end