Class: HTTPX::Timers::Timer

Inherits:
Object
  • Object
show all
Defined in:
lib/httpx/timers.rb,
sig/timers.rbs

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(interval, callback) ⇒ Timer

Returns a new instance of Timer.

Parameters:

  • interval (Interval)
  • callback (callback)


66
67
68
69
# File 'lib/httpx/timers.rb', line 66

def initialize(interval, callback)
  @interval = interval
  @callback = callback
end

Instance Attribute Details

#label ⇒ Symbol?

simpler helper which allows classification

Returns:

  • (Symbol, nil)


64
65
66
# File 'lib/httpx/timers.rb', line 64

def label
  @label
end

Instance Method Details

#cancel ⇒ void

This method returns an undefined value.



71
72
73
# File 'lib/httpx/timers.rb', line 71

def cancel
  @interval.delete(@callback)
end