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

repository_entity.rb « serializers « jira_connect « atlassian « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 819ca2b62e098acb0180a42461cbf92f8b92beb0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# frozen_string_literal: true

module Atlassian
  module JiraConnect
    module Serializers
      class RepositoryEntity < BaseEntity
        expose :id, format_with: :string
        expose :name
        expose :description
        expose :url do |project|
          project_url(project)
        end
        expose :avatar do |project|
          project.avatar_url(only_path: false)
        end

        expose :commits do |project, options|
          JiraConnect::Serializers::CommitEntity.represent options[:commits], project: project
        end
        expose :branches do |project, options|
          JiraConnect::Serializers::BranchEntity.represent options[:branches], project: project
        end
        expose :pullRequests do |project, options|
          JiraConnect::Serializers::PullRequestEntity.represent options[:merge_requests], project: project
        end
      end
    end
  end
end