Class: Brut::TUI::Script::Events::PhaseStarted

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

Overview

Fired when a phase starts, but before any steps have executed

Direct Known Subclasses

PhaseCompleted

Instance Method Summary collapse

Methods inherited from Events::BaseEvent

#drain_then_exit?, #exit?, handler_method_name

Constructor Details

#initialize(description, step_number:, total_steps:) ⇒ PhaseStarted

Returns a new instance of PhaseStarted.



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

def initialize(description, step_number:, total_steps:)
  @description = description
  @step_number = step_number
  @total_steps = total_steps
end

Instance Method Details

#deconstruct_keys(keys = nil) ⇒ Object

Adds description, step_number (1-based), and total_steps to the keyword arguments.



10
11
12
# File 'lib/brut/tui/script/events/phase_started.rb', line 10

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

#to_sObject



13
# File 'lib/brut/tui/script/events/phase_started.rb', line 13

def to_s = @description