Class: Cutoff::CutoffExceededError

Inherits:
Timeout::Error
  • Object
show all
Includes:
CutoffError
Defined in:
lib/cutoff/error.rb

Overview

Raised by #checkpoint! if the time has been exceeded

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cutoff) ⇒ CutoffExceededError

Returns a new instance of CutoffExceededError.



23
24
25
26
27
28
29
30
31
# File 'lib/cutoff/error.rb', line 23

def initialize(cutoff)
  @cutoff = cutoff

  super(message_with_meta(
    'Cutoff exceeded',
    allowed_seconds: cutoff.allowed_seconds,
    elapsed_seconds: cutoff.elapsed_seconds
  ))
end

Instance Attribute Details

#cutoffObject (readonly)

Returns the value of attribute cutoff.



21
22
23
# File 'lib/cutoff/error.rb', line 21

def cutoff
  @cutoff
end