Class: Gitlab::Ci::Status::Build::Stop

Inherits:
Extended
  • Object
show all
Defined in:
lib/gitlab/ci/status/build/stop.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Extended

#initialize

Constructor Details

This class inherits a constructor from Gitlab::Ci::Status::Extended

Class Method Details

.matches?(build, user) ⇒ Boolean

Returns:

  • (Boolean)

36
37
38
# File 'lib/gitlab/ci/status/build/stop.rb', line 36

def self.matches?(build, user)
  build.playable? && build.stops_environment?
end

Instance Method Details

#action_button_titleObject


24
25
26
# File 'lib/gitlab/ci/status/build/stop.rb', line 24

def action_button_title
  _('Stop this environment')
end

#action_iconObject


16
17
18
# File 'lib/gitlab/ci/status/build/stop.rb', line 16

def action_icon
  'stop'
end

#action_methodObject


32
33
34
# File 'lib/gitlab/ci/status/build/stop.rb', line 32

def action_method
  :post
end

#action_pathObject


28
29
30
# File 'lib/gitlab/ci/status/build/stop.rb', line 28

def action_path
  play_project_job_path(subject.project, subject)
end

#action_titleObject


20
21
22
# File 'lib/gitlab/ci/status/build/stop.rb', line 20

def action_title
  'Stop'
end

#has_action?Boolean

Returns:

  • (Boolean)

12
13
14
# File 'lib/gitlab/ci/status/build/stop.rb', line 12

def has_action?
  can?(user, :update_build, subject)
end

#labelObject


8
9
10
# File 'lib/gitlab/ci/status/build/stop.rb', line 8

def label
  'manual stop action'
end