Module: Authentication::Logic::ActsAsAuthentic::LoggedInStatus::Methods::InstanceMethods
- Defined in:
- lib/auth/logic/acts_as_authentic/logged_in_status.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#logged_in? ⇒ Boolean
Returns true if the last_request_at > logged_in_timeout.
-
#logged_out? ⇒ Boolean
Opposite of logged_in?.
Instance Method Details
#logged_in? ⇒ Boolean
Returns true if the last_request_at > logged_in_timeout.
62 63 64 65 66 67 68 69 70 |
# File 'lib/auth/logic/acts_as_authentic/logged_in_status.rb', line 62 def logged_in? unless respond_to?(:last_request_at) raise( "Can not determine the records login state because " \ "there is no last_request_at column" ) end !last_request_at.nil? && last_request_at > logged_in_timeout.seconds.ago end |
#logged_out? ⇒ Boolean
Opposite of logged_in?
73 74 75 |
# File 'lib/auth/logic/acts_as_authentic/logged_in_status.rb', line 73 def logged_out? !logged_in? end |