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)


68
69
70
71
# File 'lib/httpx/timers.rb', line 68

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

Instance Attribute Details

#labelSymbol?

simpler helper which allows classification

Returns:

  • (Symbol, nil)


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

def label
  @label
end

Instance Method Details

#cancelvoid

This method returns an undefined value.



73
74
75
# File 'lib/httpx/timers.rb', line 73

def cancel
  @interval.delete(@callback)
end