Class: FastExt::UserAuthenticator

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

Instance Method Summary collapse

Constructor Details

#initialize(user) ⇒ UserAuthenticator

Returns a new instance of UserAuthenticator.



4
5
6
# File 'app/models/fast_ext/user_authenticator.rb', line 4

def initialize(user)
  @user = user
end

Instance Method Details

#authenticate(unencrypted_password) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'app/models/fast_ext/user_authenticator.rb', line 8

def authenticate(unencrypted_password)
  return false unless @user
  if @user.password == unencrypted_password
    @user
  else
    false
  end

end