Module: Authlogic::ActsAsAuthentic::LoggedInStatus::Methods::InstanceMethods

Defined in:
lib/authlogic/acts_as_authentic/logged_in_status.rb

Instance Method Summary collapse

Instance Method Details

#logged_in?Boolean

Returns true if the last_request_at > logged_in_timeout.

Returns:

  • (Boolean)


42
43
44
45
# File 'lib/authlogic/acts_as_authentic/logged_in_status.rb', line 42

def logged_in?
  raise "Can not determine the records login state because there is no last_request_at column" if !respond_to?(:last_request_at)
  !last_request_at.nil? && last_request_at > logged_in_timeout.seconds.ago
end

#logged_out?Boolean

Opposite of logged_in?

Returns:

  • (Boolean)


48
49
50
# File 'lib/authlogic/acts_as_authentic/logged_in_status.rb', line 48

def logged_out?
  !logged_in?
end