lib/traffic_jam/limit.rb
# Increment the amount used by the given number. Does not perform increment
# if the operation would exceed the limit. Raises an exception if the
# operation is unsuccessful. Time of# increment can be specified optionally
# with a keyword argument, which is useful for rolling back with a
# decrement.
#
# @param amount [Integer] amount to increment by
# @param time [Time] time when increment occurs
# @return [nil]
# @raise [TrafficJam::LimitExceededError] if incrementing would exceed the
#   limit
Increment the amount used by the given number. Does not perform increment
if the operation would exceed the limit. Raises an exception if the
operation is unsuccessful. Time of# increment can be specified optionally
with a keyword argument, which is useful for rolling back with a
decrement.
Increment the amount used by the given number . Does not perform increment if the operation would exceed the limit . Raises an exception if the operation is unsuccessful . Time of# increment can be specified optionally with a keyword argument which is useful for rolling back with a decrement .
def increment!(amount = 1, time: Time.now)
      if !increment(amount, time: time)
        raise TrafficJam::LimitExceededError.new(self)
      end
    end
def increment! ( amount = 1 , time : Time . now ) if ! increment ( amount , time : time ) raise TrafficJam :: LimitExceededError . new ( self ) end end
Increment the amount used by the given number.
Increment the amount used by the given number .
None
nil
[TrafficJam::LimitExceededError] if incrementing would exceed the limit
[ TrafficJam :: LimitExceededError ] if incrementing would exceed the limit
amount
amount to increment by
amount to increment by
time
time when increment occurs
time when increment occurs
now
<not_specific>