Class: GoogleAuthServer

Inherits:
Object
  • Object
show all
Defined in:
lib/utilities/_google/auth_server.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(port: 8080, timeout: 60) ⇒ GoogleAuthServer

Returns a new instance of GoogleAuthServer.



11
12
13
14
15
16
# File 'lib/utilities/_google/auth_server.rb', line 11

def initialize(port: 8080, timeout: 60)
  @port = port
  @timeout = timeout
  @auth_code = nil
  @auth_received = false
end

Class Method Details

.capture_auth_code(port: 8080, timeout: 60) ⇒ Object



7
8
9
# File 'lib/utilities/_google/auth_server.rb', line 7

def self.capture_auth_code(port: 8080, timeout: 60)
  new(port: port, timeout: timeout).capture_auth_code
end

Instance Method Details

#capture_auth_codeObject



18
19
20
21
# File 'lib/utilities/_google/auth_server.rb', line 18

def capture_auth_code
  server, server_thread = start_callback_server
  wait_for_auth_code(server, server_thread)
end