Class: IO::Event::Timers::Handle
- Inherits:
-
Object
- Object
- IO::Event::Timers::Handle
- Defined in:
- lib/io/event/timers.rb
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#offset ⇒ Object
readonly
Returns the value of attribute offset.
Instance Method Summary collapse
- #<(other) ⇒ Object
- #>(other) ⇒ Object
- #call ⇒ Object
- #cancel! ⇒ Object
- #cancelled? ⇒ Boolean
-
#initialize(offset, block) ⇒ Handle
constructor
A new instance of Handle.
Constructor Details
#initialize(offset, block) ⇒ Handle
Returns a new instance of Handle.
12 13 14 15 |
# File 'lib/io/event/timers.rb', line 12 def initialize(offset, block) @offset = offset @block = block end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
26 27 28 |
# File 'lib/io/event/timers.rb', line 26 def block @block end |
#offset ⇒ Object (readonly)
Returns the value of attribute offset.
25 26 27 |
# File 'lib/io/event/timers.rb', line 25 def offset @offset end |
Instance Method Details
#<(other) ⇒ Object
17 18 19 |
# File 'lib/io/event/timers.rb', line 17 def < other @offset < other.offset end |
#>(other) ⇒ Object
21 22 23 |
# File 'lib/io/event/timers.rb', line 21 def > other @offset > other.offset end |
#call ⇒ Object
28 29 30 |
# File 'lib/io/event/timers.rb', line 28 def call(...) @block.call(...) end |
#cancel! ⇒ Object
32 33 34 |
# File 'lib/io/event/timers.rb', line 32 def cancel! @block = nil end |
#cancelled? ⇒ Boolean
36 37 38 |
# File 'lib/io/event/timers.rb', line 36 def cancelled? @block.nil? end |