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.


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

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


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

def file_set
  @file_set
end

#userObject (readonly)

Returns the value of attribute user


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

def user
  @user
end

Instance Method Details

#callObject


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

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

#messageObject

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


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

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

#subjectObject

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


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

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