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
23
24
25
|
# File 'lib/swarm/participants/trace_participant.rb', line 23
def append_to_hive_trace
hive.trace(text)
end
|
#append_to_workitem_trace ⇒ Object
17
18
19
20
21
|
# File 'lib/swarm/participants/trace_participant.rb', line 17
def append_to_workitem_trace
traced = workitem["traced"] || []
traced << text
expression.workitem = workitem.merge("traced" => traced)
end
|
#text ⇒ Object
13
14
15
|
# File 'lib/swarm/participants/trace_participant.rb', line 13
def text
@text ||= arguments.fetch("text", nil)
end
|
#work ⇒ Object
5
6
7
8
9
10
11
|
# File 'lib/swarm/participants/trace_participant.rb', line 5
def work
if text
append_to_workitem_trace
append_to_hive_trace
end
expression.reply
end
|