Class: Gitlab::Ci::Status::Build::Cancelable

Inherits:
Extended
  • Object
show all
Defined in:
lib/gitlab/ci/status/build/cancelable.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)

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

def self.matches?(build, user)
  build.cancelable?
end

Instance Method Details

#action_button_titleObject


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

def action_button_title
  _('Cancel this job')
end

#action_iconObject


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

def action_icon
  'cancel'
end

#action_methodObject


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

def action_method
  :post
end

#action_pathObject


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

def action_path
  cancel_project_job_path(subject.project, subject)
end

#action_titleObject


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

def action_title
  'Cancel'
end

#has_action?Boolean

Returns:

  • (Boolean)

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

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