Module: NotificationRecipients::BuildService

Defined in:
app/services/notification_recipients/build_service.rb

Class Method Summary collapse

Class Method Details

.build_attention_requested_recipients(*args) ⇒ Object


44
45
46
# File 'app/services/notification_recipients/build_service.rb', line 44

def self.build_attention_requested_recipients(*args)
  ::NotificationRecipients::Builder::AttentionRequested.new(*args).notification_recipients
end

.build_merge_request_unmergeable_recipients(*args) ⇒ Object


24
25
26
# File 'app/services/notification_recipients/build_service.rb', line 24

def self.build_merge_request_unmergeable_recipients(*args)
  ::NotificationRecipients::Builder::MergeRequestUnmergeable.new(*args).notification_recipients
end

.build_new_note_recipients(*args) ⇒ Object


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

def self.build_new_note_recipients(*args)
  ::NotificationRecipients::Builder::NewNote.new(*args).notification_recipients
end

.build_new_release_recipients(*args) ⇒ Object


32
33
34
# File 'app/services/notification_recipients/build_service.rb', line 32

def self.build_new_release_recipients(*args)
  ::NotificationRecipients::Builder::NewRelease.new(*args).notification_recipients
end

.build_new_review_recipients(*args) ⇒ Object


36
37
38
# File 'app/services/notification_recipients/build_service.rb', line 36

def self.build_new_review_recipients(*args)
  ::NotificationRecipients::Builder::NewReview.new(*args).notification_recipients
end

.build_project_maintainers_recipients(target, **args) ⇒ Object


28
29
30
# File 'app/services/notification_recipients/build_service.rb', line 28

def self.build_project_maintainers_recipients(target, **args)
  ::NotificationRecipients::Builder::ProjectMaintainers.new(target, **args).notification_recipients
end

.build_recipients(target, current_user, **args) ⇒ Object


16
17
18
# File 'app/services/notification_recipients/build_service.rb', line 16

def self.build_recipients(target, current_user, **args)
  ::NotificationRecipients::Builder::Default.new(target, current_user, **args).notification_recipients
end

.build_requested_review_recipients(*args) ⇒ Object


40
41
42
# File 'app/services/notification_recipients/build_service.rb', line 40

def self.build_requested_review_recipients(*args)
  ::NotificationRecipients::Builder::RequestReview.new(*args).notification_recipients
end

.notifiable?(user, *args) ⇒ Boolean

Returns:

  • (Boolean)

12
13
14
# File 'app/services/notification_recipients/build_service.rb', line 12

def self.notifiable?(user, *args)
  NotificationRecipient.new(user, *args).notifiable?
end

.notifiable_users(users, *args) ⇒ Object


8
9
10
# File 'app/services/notification_recipients/build_service.rb', line 8

def self.notifiable_users(users, *args)
  users.compact.map { |u| NotificationRecipient.new(u, *args) }.select(&:notifiable?).map(&:user)
end