Class: HTTPX::Timers::Timer
- Inherits:
-
Object
- Object
- HTTPX::Timers::Timer
- Defined in:
- lib/httpx/timers.rb,
sig/timers.rbs
Instance Attribute Summary collapse
-
#label ⇒ Symbol?
simpler helper which allows classification.
Instance Method Summary collapse
- #cancel ⇒ void
-
#initialize(interval, callback) ⇒ Timer
constructor
A new instance of Timer.
Constructor Details
#initialize(interval, callback) ⇒ Timer
Returns a new instance of Timer.
68 69 70 71 |
# File 'lib/httpx/timers.rb', line 68 def initialize(interval, callback) @interval = interval @callback = callback end |
Instance Attribute Details
#label ⇒ Symbol?
simpler helper which allows classification
66 67 68 |
# File 'lib/httpx/timers.rb', line 66 def label @label end |
Instance Method Details
#cancel ⇒ void
This method returns an undefined value.
73 74 75 |
# File 'lib/httpx/timers.rb', line 73 def cancel @interval.delete(@callback) end |