Module: KO::Signals::AddSignal

Defined in:
lib/ko/signals.rb

Instance Method Summary collapse

Instance Method Details

#signal(name, *arg_types) ⇒ Object



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

def signal(name, *arg_types)
  signals[name.to_sym] = Signal.new(name, arg_types)

  d = respond_to?(:define_method) ? :define_method : :define_singleton_method
  send(d, name) { signals[name.to_sym] }
end