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.



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

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?



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

def logged_out?
  !logged_in?
end