Class: TraceViz::Extractors::Diagram::Processors::MessageProcessor
- Inherits:
-
Object
- Object
- TraceViz::Extractors::Diagram::Processors::MessageProcessor
- Defined in:
- lib/trace_viz/extractors/diagram/processors/message_processor.rb
Instance Method Summary collapse
-
#initialize(participants) ⇒ MessageProcessor
constructor
A new instance of MessageProcessor.
- #process_node(node, caller_node = nil) ⇒ Object
Constructor Details
#initialize(participants) ⇒ MessageProcessor
Returns a new instance of MessageProcessor.
11 12 13 14 |
# File 'lib/trace_viz/extractors/diagram/processors/message_processor.rb', line 11 def initialize(participants) @formatter = Formatters::Diagram::Sequence::MessageFormatter.new = Builders::Diagram::MessageBuilder.new(@formatter, participants) end |
Instance Method Details
#process_node(node, caller_node = nil) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/trace_viz/extractors/diagram/processors/message_processor.rb', line 16 def process_node(node, caller_node = nil) trace = node.data caller_trace = caller_node&.data [].tap do || # Handle participant transitions << .( caller_trace, trace, ) if caller_trace # Process the current node << handle_loop_start(trace) << (trace) << handle_note(trace) << handle_activation(trace) .concat(process_children(node)) << handle_deactivation(trace) << handle_loop_end(trace) # Update the current node after processing << .( trace, caller_trace, ) if caller_trace end.compact end |