Class: Interceptors::TimeoutInterceptor
- Inherits:
-
Interceptor
- Object
- Interceptor
- Interceptors::TimeoutInterceptor
- Defined in:
- lib/interceptors/timeout_interceptor.rb
Instance Method Summary collapse
- #around(ctx) ⇒ Object
-
#initialize(seconds:) ⇒ TimeoutInterceptor
constructor
A new instance of TimeoutInterceptor.
Methods inherited from Interceptor
Constructor Details
#initialize(seconds:) ⇒ TimeoutInterceptor
Returns a new instance of TimeoutInterceptor.
7 8 9 10 11 |
# File 'lib/interceptors/timeout_interceptor.rb', line 7 def initialize(seconds:) raise ArgumentError, "seconds must be positive" unless seconds.to_f.positive? @seconds = seconds.to_f end |