Class: Brut::TUI::Script::Events::CommandStdOut
- Inherits:
-
Events::BaseEvent
- Object
- Events::BaseEvent
- Brut::TUI::Script::Events::CommandStdOut
- Defined in:
- lib/brut/tui/script/events/command_std_out.rb
Overview
Fired when a command has provided at least some output on its standard output.
Direct Known Subclasses
Instance Method Summary collapse
-
#deconstruct_keys(keys = nil) ⇒ Object
Adds
description,commandandoutputto the event keywords. -
#initialize(step:, output:) ⇒ CommandStdOut
constructor
A new instance of CommandStdOut.
Methods inherited from Events::BaseEvent
#drain_then_exit?, #exit?, handler_method_name
Constructor Details
#initialize(step:, output:) ⇒ CommandStdOut
Returns a new instance of CommandStdOut.
3 4 5 6 |
# File 'lib/brut/tui/script/events/command_std_out.rb', line 3 def initialize(step:, output:) @step = step @output = output end |
Instance Method Details
#deconstruct_keys(keys = nil) ⇒ Object
Adds description, command and output to the event keywords. output is a string
containing whatever output was available. This is likely not terminated with a newline.
10 11 12 |
# File 'lib/brut/tui/script/events/command_std_out.rb', line 10 def deconstruct_keys(keys=nil) super.merge({ description: @step.description, command: @step.command, output: @output }) end |