debian-mirror-gitlab/app/models/cycle_analytics/project_level.rb

25 lines
739 B
Ruby
Raw Normal View History

2019-09-30 21:07:59 +05:30
# frozen_string_literal: true
module CycleAnalytics
2019-10-12 21:52:04 +05:30
class ProjectLevel
include LevelBase
2019-09-30 21:07:59 +05:30
attr_reader :project, :options
def initialize(project, options:)
@project = project
2019-10-12 21:52:04 +05:30
@options = options.merge(project: project)
2019-09-30 21:07:59 +05:30
end
def summary
@summary ||= ::Gitlab::CycleAnalytics::StageSummary.new(project,
from: options[:from],
2019-12-21 20:55:43 +05:30
to: options[:to],
2019-09-30 21:07:59 +05:30
current_user: options[:current_user]).data
end
def permissions(user:)
Gitlab::CycleAnalytics::Permissions.get(user: user, project: project)
end
end
end