Class: SqAuth::SqAuthSessions

Inherits:
Object
  • Object
show all
Defined in:
lib/sq_auth/sq_auth_sessions.rb

Instance Method Summary collapse

Constructor Details

#initializeSqAuthSessions

Returns a new instance of SqAuthSessions.



3
4
5
6
# File 'lib/sq_auth/sq_auth_sessions.rb', line 3

def initialize
  @sessions = {}
  @known_sessions = {}
end

Instance Method Details

#[](key) ⇒ Object



8
9
10
# File 'lib/sq_auth/sq_auth_sessions.rb', line 8

def [] key
  @sessions[key]
end

#[]=(key, value) ⇒ Object



12
13
14
15
# File 'lib/sq_auth/sq_auth_sessions.rb', line 12

def []= key, value
  @known_sessions[value] ||= SqAuthSession.new(value)
  @sessions[key] = @known_sessions[value] 
end

#delete_session(session) ⇒ Object



17
18
19
# File 'lib/sq_auth/sq_auth_sessions.rb', line 17

def delete_session session
  @known_sessions.delete(session)
end