Class: Proclib::CommandMonitor
- Inherits:
-
Object
- Object
- Proclib::CommandMonitor
- Defined in:
- lib/proclib/command_monitor.rb
Overview
Watches the given command, emitting the appropriate events on the given channel when the command does something
Instance Attribute Summary collapse
-
#channel ⇒ Object
readonly
Returns the value of attribute channel.
-
#command ⇒ Object
readonly
Returns the value of attribute command.
Instance Method Summary collapse
-
#initialize(command, channel:) ⇒ CommandMonitor
constructor
A new instance of CommandMonitor.
- #start ⇒ Object
- #wait ⇒ Object
Constructor Details
#initialize(command, channel:) ⇒ CommandMonitor
9 10 11 |
# File 'lib/proclib/command_monitor.rb', line 9 def initialize(command, channel:) @command, @channel = command, channel end |
Instance Attribute Details
#channel ⇒ Object (readonly)
Returns the value of attribute channel.
7 8 9 |
# File 'lib/proclib/command_monitor.rb', line 7 def channel @channel end |
#command ⇒ Object (readonly)
Returns the value of attribute command.
7 8 9 |
# File 'lib/proclib/command_monitor.rb', line 7 def command @command end |
Instance Method Details
#start ⇒ Object
13 14 15 |
# File 'lib/proclib/command_monitor.rb', line 13 def start io_handlers.each(&:start) end |
#wait ⇒ Object
17 18 19 |
# File 'lib/proclib/command_monitor.rb', line 17 def wait io_handlers.each(&:wait) end |