Class: Brut::TUI::Script::Events::ExecutingCommand

Inherits:
Events::BaseEvent show all
Defined in:
lib/brut/tui/script/events/executing_command.rb

Overview

Fired when a command is executed (this also serves as a base class for the results of such execution).

Instance Method Summary collapse

Methods inherited from Events::BaseEvent

#drain_then_exit?, #exit?, handler_method_name

Constructor Details

#initialize(step:) ⇒ ExecutingCommand

Returns a new instance of ExecutingCommand.



4
5
6
# File 'lib/brut/tui/script/events/executing_command.rb', line 4

def initialize(step:)
  @step = step
end

Instance Method Details

#deconstruct_keys(keys = nil) ⇒ Object

Includes description and command in the keyword arguments



9
10
11
# File 'lib/brut/tui/script/events/executing_command.rb', line 9

def deconstruct_keys(keys=nil)
  super.merge({ description: @step.description, command: @step.command })
end