Class: Utilrb::EventLoop::Event

Inherits:
Object
  • Object
show all
Defined in:
lib/utilrb/event_loop.rb

Overview

An event loop event

Instance Method Summary collapse

Constructor Details

#initialize(block) ⇒ Event

Returns a new instance of Event.



156
157
158
159
# File 'lib/utilrb/event_loop.rb', line 156

def initialize(block)
    @block = block
    @ignore = false
end

Instance Method Details

#callObject



161
162
163
# File 'lib/utilrb/event_loop.rb', line 161

def call
    @block.call
end

#ignore!Object

If called the event will be ignored and removed from all internal event queues.



167
168
169
# File 'lib/utilrb/event_loop.rb', line 167

def ignore!
    @ignore = true
end

#ignore?Boolean

Returns:

  • (Boolean)


171
172
173
# File 'lib/utilrb/event_loop.rb', line 171

def ignore?
    @ignore
end