Class: Hello::Business::Authentication::SudoModeAuthentication
- Defined in:
- lib/hello/business/authentication/sudo_mode_authentication.rb
Instance Attribute Summary collapse
-
#access ⇒ Object
readonly
Returns the value of attribute access.
Instance Method Summary collapse
- #authenticate!(password) ⇒ Object
-
#initialize(access) ⇒ SudoModeAuthentication
constructor
A new instance of SudoModeAuthentication.
Methods inherited from Base
#alert_message, #error_message, #errors, #success_message, #t
Constructor Details
#initialize(access) ⇒ SudoModeAuthentication
Returns a new instance of SudoModeAuthentication.
7 8 9 |
# File 'lib/hello/business/authentication/sudo_mode_authentication.rb', line 7 def initialize(access) @access = access end |
Instance Attribute Details
#access ⇒ Object (readonly)
Returns the value of attribute access.
5 6 7 |
# File 'lib/hello/business/authentication/sudo_mode_authentication.rb', line 5 def access @access end |
Instance Method Details
#authenticate!(password) ⇒ Object
11 12 13 14 15 |
# File 'lib/hello/business/authentication/sudo_mode_authentication.rb', line 11 def authenticate!(password) if access.user.password_is?(password) access.update!(sudo_expires_at: sudo_expires_at) end end |