Class: Swarm::TraceParticipant
Instance Attribute Summary
Attributes inherited from Participant
#expression, #hive
Instance Method Summary
collapse
Methods inherited from Participant
#arguments, #initialize, #workitem
Instance Method Details
#append_to_hive_trace ⇒ Object
25
26
27
|
# File 'lib/swarm/participants/trace_participant.rb', line 25
def append_to_hive_trace
hive.trace(text)
end
|
#append_to_workitem_trace ⇒ Object
19
20
21
22
23
|
# File 'lib/swarm/participants/trace_participant.rb', line 19
def append_to_workitem_trace
traced = workitem["traced"] || []
traced << text
expression.workitem = workitem.merge("traced" => traced)
end
|
#text ⇒ Object
15
16
17
|
# File 'lib/swarm/participants/trace_participant.rb', line 15
def text
@text ||= arguments.fetch("text", nil)
end
|
#work ⇒ Object
7
8
9
10
11
12
13
|
# File 'lib/swarm/participants/trace_participant.rb', line 7
def work
if text
append_to_workitem_trace
append_to_hive_trace
end
expression.reply
end
|