blob: 35efd8b8809d143c332bb8fa98f54d46c1c3083e (
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
30
|
# frozen_string_literal: true
module CycleAnalytics
class GroupLevel
include LevelBase
attr_reader :options
def initialize(options:)
@options = options
end
def summary
@summary ||= ::Gitlab::CycleAnalytics::GroupStageSummary.new(options[:group],
from: options[:from],
current_user: options[:current_user]).data
end
def permissions(user: nil)
STAGES.each_with_object({}) do |stage, obj|
obj[stage] = true
end
end
def stats
@stats ||= STAGES.map do |stage_name|
self[stage_name].as_json(serializer: GroupAnalyticsStageSerializer)
end
end
end
end
|