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

stage_summary.rb « cycle_analytics « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5198dd5b4eb614daa962518ca9c85bf3cb41a677 (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
# frozen_string_literal: true

module Gitlab
  module CycleAnalytics
    class StageSummary
      def initialize(project, from:, current_user:)
        @project = project
        @from = from
        @current_user = current_user
      end

      def data
        [serialize(Summary::Issue.new(project: @project, from: @from, current_user: @current_user)),
         serialize(Summary::Commit.new(project: @project, from: @from)),
         serialize(Summary::Deploy.new(project: @project, from: @from))]
      end

      private

      def serialize(summary_object)
        AnalyticsSummarySerializer.new.represent(summary_object)
      end
    end
  end
end