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


152
153
154
155
# File 'lib/utilrb/event_loop.rb', line 152

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

Instance Method Details

#callObject


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

def call
    @block.call
end

#ignore!Object

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


163
164
165
# File 'lib/utilrb/event_loop.rb', line 163

def ignore!
    @ignore = true
end

#ignore?Boolean


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

def ignore?
    @ignore
end