Class: Runkeeper::AuthorizationServer
- Inherits:
-
Object
- Object
- Runkeeper::AuthorizationServer
- Defined in:
- lib/runkeeper/token_generator.rb
Defined Under Namespace
Classes: App
Instance Method Summary collapse
- #app ⇒ Object
- #code ⇒ Object
- #has_code? ⇒ Boolean
- #server ⇒ Object
- #start ⇒ Object
- #stop ⇒ Object
- #uri ⇒ Object
Instance Method Details
#app ⇒ Object
36 37 38 |
# File 'lib/runkeeper/token_generator.rb', line 36 def app @app ||= App.new(self) end |
#code ⇒ Object
44 45 46 |
# File 'lib/runkeeper/token_generator.rb', line 44 def code app.code end |
#has_code? ⇒ Boolean
40 41 42 |
# File 'lib/runkeeper/token_generator.rb', line 40 def has_code? !code.nil? end |
#server ⇒ Object
52 53 54 |
# File 'lib/runkeeper/token_generator.rb', line 52 def server @server ||= Rack::Server.new :app => app, :Port => uri.port, :server => 'webrick' end |
#start ⇒ Object
56 57 58 |
# File 'lib/runkeeper/token_generator.rb', line 56 def start server.start end |
#stop ⇒ Object
60 61 62 |
# File 'lib/runkeeper/token_generator.rb', line 60 def stop server.server.shutdown end |
#uri ⇒ Object
48 49 50 |
# File 'lib/runkeeper/token_generator.rb', line 48 def uri @uri ||= URI.parse('http://localhost:8989') end |