Class: Userbin::Session

Inherits:
Model
  • Object
show all
Defined in:
lib/userbin/session.rb

Instance Method Summary collapse

Instance Method Details

#authenticated?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/userbin/session.rb', line 19

def authenticated?
  !user.id.nil? rescue false
end

#userObject

Hack to avoid loading a remote user



14
15
16
17
# File 'lib/userbin/session.rb', line 14

def user
  return self['user'] if self['user'].is_a?(User)
  User.new(self['user']) if self['user']
end