Class: Bcome::Driver::Gcp::Authentication::OauthSessionStore

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/objects/driver/gcp/authentication/oauth_session_store.rb

Instance Method Summary collapse

Constructor Details

#initializeOauthSessionStore

Returns a new instance of OauthSessionStore.



7
8
9
# File 'lib/objects/driver/gcp/authentication/oauth_session_store.rb', line 7

def initialize
  @oauth_sessions = []
end

Instance Method Details

#<<(session) ⇒ Object



18
19
20
# File 'lib/objects/driver/gcp/authentication/oauth_session_store.rb', line 18

def <<(session)
  @oauth_sessions << session
end

#in_memory_session_for(oauth_client_config) ⇒ Object



11
12
13
14
15
16
# File 'lib/objects/driver/gcp/authentication/oauth_session_store.rb', line 11

def in_memory_session_for(oauth_client_config)
  existing_session = @oauth_sessions.detect do |session|
    session.client_config == oauth_client_config
  end
  existing_session
end