Class: Rooibos::Message::All

Inherits:
Data
  • Object
show all
Includes:
Predicates
Defined in:
lib/rooibos/message/all.rb

Overview

Response from Command.all aggregating parallel execution.

Running multiple commands in parallel needs aggregated results. Without structured responses, handling mixed success/failure requires manual array parsing.

This response collects all child results and provides predicates for success checking. Include Predicates for safe predicate calls.

Use it to handle Command.all completions.

Example

case msg
in { type: :all, envelope: :parallel, results: }
  model.with(outputs: results)
end

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Predicates

#==, #method_missing, #respond_to_missing?, #to_sym

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Rooibos::Message::Predicates

Instance Attribute Details

#envelopeObject (readonly)

Returns the value of attribute envelope

Returns:

  • (Object)

    the current value of envelope



28
29
30
# File 'lib/rooibos/message/all.rb', line 28

def envelope
  @envelope
end

#nestedObject (readonly)

Returns the value of attribute nested

Returns:

  • (Object)

    the current value of nested



28
29
30
# File 'lib/rooibos/message/all.rb', line 28

def nested
  @nested
end

#resultsObject (readonly)

Returns the value of attribute results

Returns:

  • (Object)

    the current value of results



28
29
30
# File 'lib/rooibos/message/all.rb', line 28

def results
  @results
end

Instance Method Details

#all?Boolean

Returns true for all responses.

Returns:

  • (Boolean)


32
33
34
# File 'lib/rooibos/message/all.rb', line 32

def all?
  true
end

#deconstruct_keys(_keys) ⇒ Object

Deconstructs for pattern matching.

Returns a hash with :type, :envelope, :results, and :nested.



40
41
42
# File 'lib/rooibos/message/all.rb', line 40

def deconstruct_keys(_keys)
  { type: :all, envelope:, results:, nested: }
end