2018-11-06 04:45:35 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-11-22 10:46:02 +00:00
|
|
|
module Gitlab
|
|
|
|
module CycleAnalytics
|
2016-11-23 10:28:28 +00:00
|
|
|
class StageSummary
|
2016-12-01 12:28:24 +00:00
|
|
|
def initialize(project, from:, current_user:)
|
2016-11-22 10:46:02 +00:00
|
|
|
@project = project
|
|
|
|
@from = from
|
2016-12-01 12:28:24 +00:00
|
|
|
@current_user = current_user
|
2016-11-22 10:46:02 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def data
|
2016-12-01 12:28:24 +00:00
|
|
|
[serialize(Summary::Issue.new(project: @project, from: @from, current_user: @current_user)),
|
2016-11-22 13:29:25 +00:00
|
|
|
serialize(Summary::Commit.new(project: @project, from: @from)),
|
|
|
|
serialize(Summary::Deploy.new(project: @project, from: @from))]
|
2016-11-22 10:46:02 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def serialize(summary_object)
|
2017-01-27 13:37:14 +00:00
|
|
|
AnalyticsSummarySerializer.new.represent(summary_object)
|
2016-11-22 10:46:02 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|