Class: Gitlab::Dangerfiles::Capability

Inherits:
CapabilityStruct show all
Defined in:
lib/gitlab/dangerfiles/capability.rb

Direct Known Subclasses

ImportIntegrateBE, ImportIntegrateFE, None, Test, Tooling, UX

Defined Under Namespace

Classes: ImportIntegrateBE, ImportIntegrateFE, None, Test, Tooling, UX

Instance Attribute Summary

Attributes inherited from CapabilityStruct

#category, #kind, #labels, #project

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.for(category, **arguments) ⇒ Object



8
9
10
11
# File 'lib/gitlab/dangerfiles/capability.rb', line 8

def self.for(category, **arguments)
  (category_to_class[category] || self)
    .new(category: category, **arguments)
end

Instance Method Details

#has_capability?(teammate) ⇒ Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/gitlab/dangerfiles/capability.rb', line 25

def has_capability?(teammate)
  teammate.capabilities(project).include?(capability)
end