def increment(amount = 1, time: Time.now)
      raise ArgumentError, 'Amount must be an integer' if amount != amount.to_i
      return amount <= 0 if max.zero?
      return amount <= max if period.zero?
      return true if amount.zero?
      return false if amount > max

      !run_incr([time.to_i, amount.to_i, max, period]).nil?
    end
def increment(amount = 1, time: Time.now)
      raise ArgumentError, 'Amount must be an integer' if amount != amount.to_i
      return amount <= 0 if max.zero?
      return amount <= max if period.zero?
      return true if amount.zero?
      return false if amount > max

      !run_incr([time.to_i, amount.to_i, max, period]).nil?
    end
Constructor takes an action name as a symbol, a maximum cap, and the
 period of limit. +max+ and +period+ are required keyword arguments.

 @param action [Symbol] action name
 @param value [String] limit target value
 @param max [Integer] required limit maximum
 @param period [Integer] required limit period in seconds
 @raise [ArgumentError] if max or period is nil
 Increment the amount used by the given number. Rolls back the increment
 if the operation exceeds the limit. Returns whether the operation was
 successful. Time of increment can be specified optionally with a keyword
 argument, which is not really useful since it be undone by used.

 @param amount [Integer] amount to increment by
 @param time [Time] time when increment occurs (ignored)
 @return [Boolean] true if increment succeded and false if incrementing
   would exceed the limit