Class: Chronatog::Client::Connection::BasicAuth
- Inherits:
-
Object
- Object
- Chronatog::Client::Connection::BasicAuth
- Defined in:
- lib/chronatog/client.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, creds) ⇒ BasicAuth
constructor
A new instance of BasicAuth.
Constructor Details
#initialize(app, creds) ⇒ BasicAuth
Returns a new instance of BasicAuth.
113 114 115 116 |
# File 'lib/chronatog/client.rb', line 113 def initialize(app, creds) @app = app @username, @password = creds end |
Instance Method Details
#call(env) ⇒ Object
118 119 120 121 |
# File 'lib/chronatog/client.rb', line 118 def call(env) env["HTTP_AUTHORIZATION"] = 'Basic ' + ["#{@username}:#{@password}"].pack('m').delete("\r\n") @app.call(env) end |