Class: UsedUpServicePackJob

Inherits:
ApplicationJob
  • Object
show all
Defined in:
app/workers/used_up_service_pack_job.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(sp) ⇒ UsedUpServicePackJob

Returns a new instance of UsedUpServicePackJob.



4
5
6
# File 'app/workers/used_up_service_pack_job.rb', line 4

def initialize(sp)
  @sp = sp
end

Instance Attribute Details

#spObject (readonly)

Returns the value of attribute sp.



2
3
4
# File 'app/workers/used_up_service_pack_job.rb', line 2

def sp
  @sp
end

Instance Method Details

#performObject



8
9
10
11
12
# File 'app/workers/used_up_service_pack_job.rb', line 8

def perform
  User.where(admin: true).each do |user|
    ServicePacksMailer.used_up_email(user, @sp).deliver_now
  end
end