def clean(rate_limit_time = nil)
      rate_limit_time ||= Time.now

      @bucket.delete_if do |_, limit_hash|
        # Time limit has not run out
        return false if @time_span && rate_limit_time < (limit_hash[:set_time] + @time_span)

        # Delay has not run out
        return false if @delay && rate_limit_time < (limit_hash[:last_time] + @delay)

        true
      end
    end
def clean(rate_limit_time = nil)
      rate_limit_time ||= Time.now

      @bucket.delete_if do |_, limit_hash|
        # Time limit has not run out
        return false if @time_span && rate_limit_time < (limit_hash[:set_time] + @time_span)

        # Delay has not run out
        return false if @delay && rate_limit_time < (limit_hash[:last_time] + @delay)

        true
      end
    end
Makes a new bucket
 @param limit [Integer, nil] How many requests the user may perform in the given time_span, or nil if there should be no limit.
 @param time_span [Integer, nil] The time span after which the request count is reset, in seconds, or nil if the bucket should never be reset. (If this is nil, limit should be nil too)
 @param delay [Integer, nil] The delay for which the user has to wait after performing a request, in seconds, or nil if the user shouldn't have to wait.
 Cleans the bucket, removing all elements that aren't necessary anymore
 @param rate_limit_time [Time] The time to base the cleaning on, only useful for testing.