summaryrefslogtreecommitdiff
path: root/lib/gitlab/cycle_analytics/group_stage_summary.rb
blob: 7b5c74e1a1b2ecc2a4ededd22c9a36b5475a7142 (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
# frozen_string_literal: true

module Gitlab
  module CycleAnalytics
    class GroupStageSummary
      def initialize(group, from:, current_user:)
        @group = group
        @from = from
        @current_user = current_user
      end

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

      private

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