Class: Hyrax::AbstractMessageService

Inherits:
Object
  • Object
show all
Defined in:
app/services/hyrax/abstract_message_service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file_set, user) ⇒ AbstractMessageService

Returns a new instance of AbstractMessageService.


6
7
8
9
# File 'app/services/hyrax/abstract_message_service.rb', line 6

def initialize(file_set, user)
  @file_set = file_set
  @user = user
end

Instance Attribute Details

#file_setObject (readonly)

Returns the value of attribute file_set


4
5
6
# File 'app/services/hyrax/abstract_message_service.rb', line 4

def file_set
  @file_set
end

#userObject (readonly)

Returns the value of attribute user


4
5
6
# File 'app/services/hyrax/abstract_message_service.rb', line 4

def user
  @user
end

Instance Method Details

#callObject


11
12
13
14
15
16
# File 'app/services/hyrax/abstract_message_service.rb', line 11

def call
  Hyrax::MessengerService.deliver(job_user,
                                  user,
                                  message,
                                  subject)
end

#messageObject

Passed to Hyrax::MessengerService, override to provide message body for event.


19
20
21
# File 'app/services/hyrax/abstract_message_service.rb', line 19

def message
  raise "Override #message in the service class"
end

#subjectObject

Passed to Hyrax::MessengerService, override to provide subject for event.


24
25
26
# File 'app/services/hyrax/abstract_message_service.rb', line 24

def subject
  raise "Override #subject in the service class"
end