Class: Carpool::Driver
- Inherits:
-
Object
- Object
- Carpool::Driver
- Includes:
- Mixins::Core
- Defined in:
- lib/carpool/driver.rb
Class Attribute Summary collapse
-
.revoke_uri ⇒ Object
Returns the value of attribute revoke_uri.
-
.unauthorized_uri ⇒ Object
Returns the value of attribute unauthorized_uri.
Class Method Summary collapse
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) {|Carpool::Driver| ... } ⇒ Driver
constructor
A new instance of Driver.
Methods included from Mixins::Core
Constructor Details
Class Attribute Details
.revoke_uri ⇒ Object
Returns the value of attribute revoke_uri.
12 13 14 |
# File 'lib/carpool/driver.rb', line 12 def revoke_uri @revoke_uri end |
.unauthorized_uri ⇒ Object
Returns the value of attribute unauthorized_uri.
11 12 13 |
# File 'lib/carpool/driver.rb', line 11 def @unauthorized_uri end |
Class Method Details
.passenger(url, secret) ⇒ Object
18 19 20 |
# File 'lib/carpool/driver.rb', line 18 def passenger(url, secret) passengers << { :host => url, :secret => secret } end |
.passengers ⇒ Object
14 15 16 |
# File 'lib/carpool/driver.rb', line 14 def passengers @passengers ||= [] end |
Instance Method Details
#call(env) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/carpool/driver.rb', line 31 def call(env) @env = env env['carpool'] = Carpool::Seatbelt.new(env) unless env['carpool'] && env['carpool'] != Carpool::Seatbelt return revoke_all_instances! if is_revoking? if valid_request? manager.auth_request! unless manager.authentication_exists? return Carpool::Responder.authenticate end end result = catch(:carpool) do @app.call(env) end return result end |