Class: DeliverChangePasswordJob

Inherits:
Object
  • Object
show all
Defined in:
app/models/deliver_change_password_job.rb

Overview

Delivers the Headstart.deliver_mimi_change_password to the requested User by id as an asynchronous process.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(user_id) ⇒ DeliverChangePasswordJob

Returns a new instance of DeliverChangePasswordJob.



9
10
11
# File 'app/models/deliver_change_password_job.rb', line 9

def initialize(user_id)
  @user_id = user_id.kind_of?(User) ? user_id.id : user_id
end

Instance Attribute Details

#user_idObject (readonly)

Returns the value of attribute user_id.



7
8
9
# File 'app/models/deliver_change_password_job.rb', line 7

def user_id
  @user_id
end

Instance Method Details

#performObject



13
14
15
16
17
# File 'app/models/deliver_change_password_job.rb', line 13

def perform
  if user = User.find_by_id(@user_id)
    HeadstartMailer.deliver_change_password(user)
  end
end