Class: Process::Group::Command
- Inherits:
-
Object
- Object
- Process::Group::Command
- Defined in:
- lib/process/group.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#pid ⇒ Object
readonly
Returns the value of attribute pid.
Instance Method Summary collapse
- #foreground? ⇒ Boolean
-
#initialize(foreground: false, **options) ⇒ Command
constructor
A new instance of Command.
- #kill(signal = :INT) ⇒ Object
- #resume(*arguments) ⇒ Object
Constructor Details
#initialize(foreground: false, **options) ⇒ Command
Returns a new instance of Command.
34 35 36 37 38 39 40 |
# File 'lib/process/group.rb', line 34 def initialize(foreground: false, **) @options = @foreground = foreground @fiber = Fiber.current @pid = nil end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
42 43 44 |
# File 'lib/process/group.rb', line 42 def @options end |
#pid ⇒ Object (readonly)
Returns the value of attribute pid.
44 45 46 |
# File 'lib/process/group.rb', line 44 def pid @pid end |
Instance Method Details
#foreground? ⇒ Boolean
46 47 48 |
# File 'lib/process/group.rb', line 46 def foreground? @foreground end |
#kill(signal = :INT) ⇒ Object
54 55 56 |
# File 'lib/process/group.rb', line 54 def kill(signal = :INT) Process.kill(signal, @pid) end |
#resume(*arguments) ⇒ Object
50 51 52 |
# File 'lib/process/group.rb', line 50 def resume(*arguments) @fiber.resume(*arguments) end |