class Faraday::RateChecker
Public Class Methods
new(app)
click to toggle source
Calls superclass method
# File lib/faraday/rate_checker.rb, line 5 def initialize(app) super(app) end
Public Instance Methods
call(request_env)
click to toggle source
# File lib/faraday/rate_checker.rb, line 9 def call(request_env) @app.call(request_env).on_complete do |response_env| if response_env[:body].include?('You have exceeded your rate limit') raise BaremetricsAPI::Error::RateLimitExeeded end end end