Class: ForkHandle::Key

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

Instance Method Summary collapse

Constructor Details

#initialize(pid, tid, key) ⇒ Key

Returns a new instance of Key.



28
29
30
31
32
# File 'lib/forkhandle.rb', line 28

def initialize(pid, tid, key)
  @pid = pid
  @tid = tid
  @key = key
end

Instance Method Details

#for(*args) ⇒ Object



19
20
21
22
23
24
25
26
# File 'lib/forkhandle.rb', line 19

def for(*args)
  case
    when args.size == 1 && args.first.is_a?(Key)
      args.first
    else
      new(*args)
  end
end