Class: CycleAnalytics::ProjectLevel

Inherits:
Object
  • Object
show all
Includes:
LevelBase
Defined in:
app/models/cycle_analytics/project_level.rb

Constant Summary

Constants included from LevelBase

LevelBase::STAGES

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from LevelBase

#[], #all_medians_by_stage, #no_stats?, #stats

Constructor Details

#initialize(project, options:) ⇒ ProjectLevel

Returns a new instance of ProjectLevel.


8
9
10
11
# File 'app/models/cycle_analytics/project_level.rb', line 8

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

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options


6
7
8
# File 'app/models/cycle_analytics/project_level.rb', line 6

def options
  @options
end

#projectObject (readonly)

Returns the value of attribute project


6
7
8
# File 'app/models/cycle_analytics/project_level.rb', line 6

def project
  @project
end

Instance Method Details

#permissions(user:) ⇒ Object


20
21
22
# File 'app/models/cycle_analytics/project_level.rb', line 20

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

#summaryObject


13
14
15
16
17
18
# File 'app/models/cycle_analytics/project_level.rb', line 13

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