Class: Gitlab::Dangerfiles::Approval

Inherits:
Struct
  • Object
show all
Defined in:
lib/gitlab/dangerfiles/approval.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#categoryObject

Returns the value of attribute category

Returns:

  • (Object)

    the current value of category



7
8
9
# File 'lib/gitlab/dangerfiles/approval.rb', line 7

def category
  @category
end

#spinObject

Returns the value of attribute spin

Returns:

  • (Object)

    the current value of spin



7
8
9
# File 'lib/gitlab/dangerfiles/approval.rb', line 7

def spin
  @spin
end

Class Method Details

.from_approval_rule(rule, maintainer) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/gitlab/dangerfiles/approval.rb', line 8

def self.from_approval_rule(rule, maintainer)
  category =
    if rule["section"] == "codeowners"
      "`#{rule['name']}`"
    else
      rule["section"]
    end.to_sym

  spin = Spin.new(category, nil, maintainer, :reviewer)

  new(category, spin)
end