Class: Veeqo::Middleware::Auth
- Inherits:
-
Faraday::Middleware
- Object
- Faraday::Middleware
- Veeqo::Middleware::Auth
- Defined in:
- lib/veeqo/middleware/auth.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, options = {}) ⇒ Auth
constructor
A new instance of Auth.
Constructor Details
#initialize(app, options = {}) ⇒ Auth
Returns a new instance of Auth.
4 5 6 7 |
# File 'lib/veeqo/middleware/auth.rb', line 4 def initialize(app, = {}) @app = app @options = end |
Instance Method Details
#call(env) ⇒ Object
9 10 11 12 |
# File 'lib/veeqo/middleware/auth.rb', line 9 def call(env) env[:request_headers]['x-api-key'] = @options[:api_key] @app.call env end |