Module Tap::Signals
In: lib/tap/signals.rb
lib/tap/signals/class_methods.rb
lib/tap/signals/configure.rb
lib/tap/signals/help.rb
lib/tap/signals/load.rb
lib/tap/signals/module_methods.rb

Signals is a module providing signaling capbilities for objects. Signals are effectively bound to methods with pre-processing that allows inputs from the command line (ie an ARGV) or from interfaces like HTTP that commonly produce a parameters hash.

Methods

sig   signal   signal?   signals  

Classes and Modules

Module Tap::Signals::ClassMethods
Module Tap::Signals::ModuleMethods
Class Tap::Signals::Configure
Class Tap::Signals::Help
Class Tap::Signals::Load

Public Instance methods

[Source]

    # File lib/tap/signals.rb, line 35
35:     def sig(signal)
36:       signal = signal.class
37:       signals.each_pair do |sig, value|
38:         return sig if value == signal
39:       end
40:       nil
41:     end

[Source]

    # File lib/tap/signals.rb, line 21
21:     def signal(sig, &block)
22:       sig = sig.to_s
23:       unless signal = signals[sig]
24:         raise "unknown signal: #{sig} (#{self.class})"
25:       end
26:       
27:       signal.new(self, &block)
28:     end

[Source]

    # File lib/tap/signals.rb, line 30
30:     def signal?(sig)
31:       sig = sig.to_s
32:       signals.has_key?(sig.to_s)
33:     end

[Source]

    # File lib/tap/signals.rb, line 14
14:     def signals
15:       # memoization here is tempting, but a bad idea because the signals must
16:       # be recalculated in case of added modules.  see cache_signals for a
17:       # better way.
18:       self.class.signals
19:     end

[Validate]