summaryrefslogtreecommitdiff
path: root/app/models/cycle_analytics/project_level.rb
blob: a8cc1d25044d6fd630854b2f7e64c084273dd568 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# frozen_string_literal: true

module CycleAnalytics
  class ProjectLevel < Base

    attr_reader :project, :options

    def initialize(project, options:)
      @project = project
      @options = options
    end

    def summary
      @summary ||= ::Gitlab::CycleAnalytics::StageSummary.new(project,
                                                              from: options[:from],
                                                              current_user: options[:current_user]).data
    end

    def permissions(user:)
      Gitlab::CycleAnalytics::Permissions.get(user: user, project: project)
    end
  end
end