Module: Tra

Extended by:
Forwardable
Defined in:
lib/tra.rb,
lib/tra/fork.rb,
lib/tra/mailbox.rb

Defined Under Namespace

Modules: Fork, Mailbox

Class Method Summary collapse

Class Method Details

.enumeratorObject



12
13
14
15
16
# File 'lib/tra.rb', line 12

def enumerator
  @enumerator ||= Enumerator.new do |y|
    loop { y << QUEUE.pop }
  end
end

.on(pattern, &action) ⇒ Object



21
22
23
# File 'lib/tra.rb', line 21

def on pattern, &action
  PATTERNS[pattern] = action
end

.runObject



25
26
27
28
29
30
# File 'lib/tra.rb', line 25

def run
  Mailbox.receive

  patch_Object_shamelessly
  patch_Integer_shamelessly
end