master
 1class ChangePassword
 2  def initialize(context, current_user = context.current_user)
 3    @context = context
 4    @current_user = current_user
 5  end
 6
 7  def run(password, password_confirmation)
 8    if @current_user.change_password(password, password_confirmation)
 9      @context.password_changed(@current_user)
10    else
11      @context.password_changed_failed(@current_user)
12    end
13  end
14end