Class: Bcome::LoadingBar::PidBucket
- Inherits:
-
Object
- Object
- Bcome::LoadingBar::PidBucket
- Includes:
- Singleton
- Defined in:
- lib/objects/loading_bar/pid_bucket.rb
Instance Method Summary collapse
- #-(pid) ⇒ Object
- #<<(pid) ⇒ Object
-
#initialize ⇒ PidBucket
constructor
A new instance of PidBucket.
- #stop_all ⇒ Object
Constructor Details
#initialize ⇒ PidBucket
Returns a new instance of PidBucket.
8 9 10 |
# File 'lib/objects/loading_bar/pid_bucket.rb', line 8 def initialize @pids = [] end |
Instance Method Details
#-(pid) ⇒ Object
16 17 18 |
# File 'lib/objects/loading_bar/pid_bucket.rb', line 16 def -(pid) @pids -= [pid] end |
#<<(pid) ⇒ Object
12 13 14 |
# File 'lib/objects/loading_bar/pid_bucket.rb', line 12 def <<(pid) @pids << pid end |
#stop_all ⇒ Object
20 21 22 23 24 |
# File 'lib/objects/loading_bar/pid_bucket.rb', line 20 def stop_all @pids.map do |pid| ::Process.kill(::Bcome::LoadingBar::Indicator::Base::SIGNAL_STOP, pid) end end |