Class: JayDoubleuTee::Authorization
- Inherits:
-
Object
- Object
- JayDoubleuTee::Authorization
- Defined in:
- lib/jay_doubleu_tee/authorization.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#decoder ⇒ Object
readonly
Returns the value of attribute decoder.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ Authorization
constructor
A new instance of Authorization.
Constructor Details
#initialize(app) ⇒ Authorization
Returns a new instance of Authorization.
12 13 14 15 16 |
# File 'lib/jay_doubleu_tee/authorization.rb', line 12 def initialize(app) @app = app @decoder = Decoder.new @config = JayDoubleuTee.config end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
10 11 12 |
# File 'lib/jay_doubleu_tee/authorization.rb', line 10 def config @config end |
#decoder ⇒ Object (readonly)
Returns the value of attribute decoder.
10 11 12 |
# File 'lib/jay_doubleu_tee/authorization.rb', line 10 def decoder @decoder end |
Instance Method Details
#call(env) ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/jay_doubleu_tee/authorization.rb', line 18 def call(env) auth = decoder.call(env["HTTP_AUTHORIZATION"]) return (auth) if (auth) with_auth(auth) do @app.call(env) end end |