Class: Faraday::ApiKey

Inherits:
Middleware
  • Object
show all
Defined in:
lib/faraday/api_key.rb

Instance Method Summary collapse

Instance Method Details

#call(env) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/faraday/api_key.rb', line 4

def call(env)
  unless env[:request_headers]['X-Reviewed-Authorization']
    raise ::Reviewed::ConfigurationError.new(msg: "Please set the API key for your Reviewed::Client instance before making a request")
  end

  @app.call(env)
end