gitlab-org--gitlab-foss/app/models/cycle_analytics/project_level.rb

24 lines
659 B
Ruby
Raw Normal View History

# frozen_string_literal: true
module CycleAnalytics
class ProjectLevel
include LevelBase
2019-07-10 07:33:25 -04:00
attr_reader :project, :options
2019-07-08 04:26:02 -04:00
def initialize(project, options:)
@project = project
@options = options.merge(project: project)
end
def summary
2019-07-10 07:33:25 -04:00
@summary ||= ::Gitlab::CycleAnalytics::StageSummary.new(project,
from: options[:from],
current_user: options[:current_user]).data
end
def permissions(user:)
2019-07-10 07:33:25 -04:00
Gitlab::CycleAnalytics::Permissions.get(user: user, project: project)
end
end
end