Class: Nervion::ErrorCounter
- Inherits:
-
Object
- Object
- Nervion::ErrorCounter
- Defined in:
- lib/nervion/reconnection_scheduler.rb
Instance Attribute Summary collapse
-
#count ⇒ Object
readonly
Returns the value of attribute count.
Instance Method Summary collapse
-
#initialize(limit) ⇒ ErrorCounter
constructor
A new instance of ErrorCounter.
- #notify_error ⇒ Object
Constructor Details
#initialize(limit) ⇒ ErrorCounter
Returns a new instance of ErrorCounter.
38 39 40 41 |
# File 'lib/nervion/reconnection_scheduler.rb', line 38 def initialize(limit) @count = 0 @limit = limit end |
Instance Attribute Details
#count ⇒ Object (readonly)
Returns the value of attribute count.
36 37 38 |
# File 'lib/nervion/reconnection_scheduler.rb', line 36 def count @count end |
Instance Method Details
#notify_error ⇒ Object
43 44 45 46 |
# File 'lib/nervion/reconnection_scheduler.rb', line 43 def notify_error @count += 1 raise TooManyConnectionErrors if too_many_errors? end |