Class: Lapidarist::Threads
- Inherits:
-
Object
- Object
- Lapidarist::Threads
- Defined in:
- lib/lapidarist/threads.rb
Instance Method Summary collapse
- #<<(thread) ⇒ Object
- #aborting? ⇒ Boolean
-
#initialize ⇒ Threads
constructor
A new instance of Threads.
- #stop ⇒ Object
Constructor Details
#initialize ⇒ Threads
Returns a new instance of Threads.
3 4 5 6 |
# File 'lib/lapidarist/threads.rb', line 3 def initialize @threads = [] @abort = false end |
Instance Method Details
#<<(thread) ⇒ Object
8 9 10 |
# File 'lib/lapidarist/threads.rb', line 8 def <<(thread) @threads += Array(thread) end |
#aborting? ⇒ Boolean
22 23 24 |
# File 'lib/lapidarist/threads.rb', line 22 def aborting? @abort end |
#stop ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/lapidarist/threads.rb', line 12 def stop if aborting? kill exit! STATUS_ERROR else @abort = true abort end end |