Class: LightIO::Watchers::Timer

Inherits:
Watcher
  • Object
show all
Defined in:
lib/lightio/watchers/timer.rb

Instance Attribute Summary collapse

Attributes inherited from Watcher

#callback

Instance Method Summary collapse

Methods inherited from Watcher

#set_callback

Constructor Details

#initialize(interval) ⇒ Timer

Returns a new instance of Timer.



7
8
9
# File 'lib/lightio/watchers/timer.rb', line 7

def initialize(interval)
  @interval = interval
end

Instance Attribute Details

#intervalObject (readonly)

Returns the value of attribute interval.



4
5
6
# File 'lib/lightio/watchers/timer.rb', line 4

def interval
  @interval
end

#uuidObject

Returns the value of attribute uuid.



5
6
7
# File 'lib/lightio/watchers/timer.rb', line 5

def uuid
  @uuid
end

Instance Method Details

#start(ioloop) ⇒ Object



11
12
13
# File 'lib/lightio/watchers/timer.rb', line 11

def start(ioloop)
  ioloop.add_timer(self)
end