gitlab-org--gitlab-foss/lib/gitlab/cycle_analytics/stage_summary.rb

24 lines
626 B
Ruby
Raw Normal View History

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:)
@project = project
@from = from
2016-12-01 12:28:24 +00:00
@current_user = current_user
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))]
end
private
def serialize(summary_object)
AnalyticsSummarySerializer.new.represent(summary_object)
end
end
end
end