Class: UserBouncer
- Inherits:
-
Object
- Object
- UserBouncer
- Defined in:
- app/services/user_bouncer.rb
Instance Method Summary collapse
-
#initialize(user, tracking) ⇒ UserBouncer
constructor
A new instance of UserBouncer.
- #let_user_in?(password) ⇒ Boolean
Constructor Details
#initialize(user, tracking) ⇒ UserBouncer
Returns a new instance of UserBouncer.
4 5 6 7 |
# File 'app/services/user_bouncer.rb', line 4 def initialize(user, tracking) @user = user @tracking = tracking end |
Instance Method Details
#let_user_in?(password) ⇒ Boolean
10 11 12 13 14 15 |
# File 'app/services/user_bouncer.rb', line 10 def let_user_in?(password) return false unless @user&.allow_login? @password = password too_many_attempts? ? (log_attempt && false) : try_password end |