Class: NotificationRecipients::Builder::NewRelease

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

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

Constructor Details

#initialize(target) ⇒ NewRelease

Returns a new instance of NewRelease.


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

def initialize(target)
  @target = target
end

Instance Attribute Details

#targetObject (readonly)

Returns the value of attribute target.


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

def target
  @target
end

Instance Method Details

#acting_userObject


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

def acting_user
  target.author
end

#build!Object


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

def build!
  add_recipients(target.project.authorized_users, :custom, nil)
end

#custom_actionObject


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

def custom_action
  :new_release
end