Class: Mindee::HTTP::CancellationToken
- Inherits:
-
Object
- Object
- Mindee::HTTP::CancellationToken
- Defined in:
- lib/mindee/http/cancellation_token.rb
Overview
Custom cancellation token class for polling.
Instance Method Summary collapse
-
#cancel ⇒ Object
Cancel the token.
-
#canceled? ⇒ Boolean
Check if the token is canceled.
-
#initialize ⇒ CancellationToken
constructor
A new instance of CancellationToken.
Constructor Details
#initialize ⇒ CancellationToken
Returns a new instance of CancellationToken.
9 10 11 |
# File 'lib/mindee/http/cancellation_token.rb', line 9 def initialize @is_cancelled = false end |
Instance Method Details
#cancel ⇒ Object
Cancel the token.
14 15 16 |
# File 'lib/mindee/http/cancellation_token.rb', line 14 def cancel @is_cancelled = true end |
#canceled? ⇒ Boolean
Check if the token is canceled.
19 20 21 |
# File 'lib/mindee/http/cancellation_token.rb', line 19 def canceled? @is_cancelled end |