Class: Analytics::CycleAnalytics::ProjectLevel
- Inherits:
-
Object
- Object
- Analytics::CycleAnalytics::ProjectLevel
- Defined in:
- app/models/analytics/cycle_analytics/project_level.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#project ⇒ Object
readonly
Returns the value of attribute project.
Instance Method Summary collapse
- #[](stage_name) ⇒ Object
-
#initialize(project:, options:) ⇒ ProjectLevel
constructor
A new instance of ProjectLevel.
- #permissions(user:) ⇒ Object
- #stats ⇒ Object
- #summary ⇒ Object
Constructor Details
#initialize(project:, options:) ⇒ ProjectLevel
Returns a new instance of ProjectLevel.
8 9 10 11 |
# File 'app/models/analytics/cycle_analytics/project_level.rb', line 8 def initialize(project:, options:) @project = project @options = .merge(project: project) end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
6 7 8 |
# File 'app/models/analytics/cycle_analytics/project_level.rb', line 6 def @options end |
#project ⇒ Object (readonly)
Returns the value of attribute project.
6 7 8 |
# File 'app/models/analytics/cycle_analytics/project_level.rb', line 6 def project @project end |
Instance Method Details
#[](stage_name) ⇒ Object
31 32 33 |
# File 'app/models/analytics/cycle_analytics/project_level.rb', line 31 def [](stage_name) ::CycleAnalytics::ProjectLevelStageAdapter.new(build_stage(stage_name), ) end |
#permissions(user:) ⇒ Object
21 22 23 |
# File 'app/models/analytics/cycle_analytics/project_level.rb', line 21 def (user:) Gitlab::CycleAnalytics::Permissions.get(user: user, project: project) end |
#stats ⇒ Object
25 26 27 28 29 |
# File 'app/models/analytics/cycle_analytics/project_level.rb', line 25 def stats @stats ||= default_stage_names.map do |stage_name| self[stage_name].as_json end end |
#summary ⇒ Object
13 14 15 16 17 18 19 |
# File 'app/models/analytics/cycle_analytics/project_level.rb', line 13 def summary @summary ||= ::Gitlab::CycleAnalytics::StageSummary.new( project, options: , current_user: [:current_user] ).data end |