Class: Veeqo::Middleware::Auth

Inherits:
Faraday::Middleware
  • Object
show all
Defined in:
lib/veeqo/middleware/auth.rb

Instance Method Summary collapse

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, options = {})
  @app = app
  @options = 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