Class: NotificationRecipients::Builder::ProjectMaintainers

Inherits:
Base
  • Object
show all
Defined in:
app/services/notification_recipients/builder/project_maintainers.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#add_recipients, #custom_action, #filter!, #group, #make_recipient, #notification_recipients, #project, #recipients, #recipients_target, #user_scope

Constructor Details

#initialize(target, action:) ⇒ ProjectMaintainers

Returns a new instance of ProjectMaintainers.



8
9
10
11
# File 'app/services/notification_recipients/builder/project_maintainers.rb', line 8

def initialize(target, action:)
  @target = target
  @action = action
end

Instance Attribute Details

#targetObject (readonly)

Returns the value of attribute target.



6
7
8
# File 'app/services/notification_recipients/builder/project_maintainers.rb', line 6

def target
  @target
end

Instance Method Details

#acting_userObject



20
21
22
# File 'app/services/notification_recipients/builder/project_maintainers.rb', line 20

def acting_user
  nil
end

#build!Object



13
14
15
16
17
18
# File 'app/services/notification_recipients/builder/project_maintainers.rb', line 13

def build!
  return [] unless project

  add_recipients(project.team.maintainers, :mention, nil)
  add_recipients(project.team.owners, :mention, nil)
end