Welcome to mirror list, hosted at ThFree Co, Russian Federation.

project_entity.rb « serializers « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: cbdc19a83ce26955e26e25578a912cf4202822fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# frozen_string_literal: true

class ProjectEntity < Grape::Entity
  include RequestAwareEntity

  expose :id, documentation: { type: 'integer', example: 1 }
  expose :name, documentation: { type: 'string', example: 'GitLab' }

  expose :full_path, documentation: { type: 'string', example: 'gitlab-org/gitlab' } do |project|
    project_path(project)
  end

  expose :full_name, documentation: { type: 'string', example: 'GitLab Org / GitLab' } do |project|
    project.full_name
  end

  expose :refs_url do |project|
    refs_project_path(project)
  end
end