Class: Textus::Hooks::FireReport

Inherits:
Data
  • Object
show all
Defined in:
lib/textus/hooks/fire_report.rb

Overview

Outcome of a single Dispatcher#publish call.

fired — hook names that ran to completion errored — hook names that raised timed_out — hook names whose worker thread exceeded the deadline

Callers that care about hook health (tests, strict embedders) can check #ok? or inspect #failures. The dispatcher itself never raises on a hook failure unless strict: true was passed to #publish.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(fired:, errored:, timed_out:) ⇒ FireReport

Returns a new instance of FireReport.



15
16
17
# File 'lib/textus/hooks/fire_report.rb', line 15

def initialize(fired:, errored:, timed_out:)
  super(fired: fired.dup.freeze, errored: errored.dup.freeze, timed_out: timed_out.dup.freeze)
end

Instance Attribute Details

#erroredObject (readonly)

Returns the value of attribute errored

Returns:

  • (Object)

    the current value of errored



14
15
16
# File 'lib/textus/hooks/fire_report.rb', line 14

def errored
  @errored
end

#firedObject (readonly)

Returns the value of attribute fired

Returns:

  • (Object)

    the current value of fired



14
15
16
# File 'lib/textus/hooks/fire_report.rb', line 14

def fired
  @fired
end

#timed_outObject (readonly)

Returns the value of attribute timed_out

Returns:

  • (Object)

    the current value of timed_out



14
15
16
# File 'lib/textus/hooks/fire_report.rb', line 14

def timed_out
  @timed_out
end

Instance Method Details

#failuresObject



20
# File 'lib/textus/hooks/fire_report.rb', line 20

def failures = errored + timed_out

#ok?Boolean

Returns:

  • (Boolean)


19
# File 'lib/textus/hooks/fire_report.rb', line 19

def ok? = errored.empty? && timed_out.empty?