lib/dogviz.rb in dogviz-0.0.12 vs lib/dogviz.rb in dogviz-0.0.13
- old
+ new
@@ -7,10 +7,13 @@
@description = description
end
def name
@processor.name
end
+ def description
+ @description
+ end
end
module Flowable
def does(action)
Process.new(self, action)
end
@@ -463,12 +466,12 @@
detail = options[:label]
receiver_label = other.name
sender_label = from.name
if other.is_a?(Process)
+ detail = process_annotations(detail, sender_label, receiver_label, other.description)
receiver_label = process_start_label(receiver_label)
- detail = process_annotations(detail)
elsif from.is_a?(Process)
receiver_label = process_end_label(receiver_label)
end
lines << "#{sender_label} -> #{receiver_label}: #{detail}"
end
@@ -485,13 +488,13 @@
def process_end_label(receiver_label)
"-#{receiver_label}"
end
- def process_annotations(detail)
+ def process_annotations(detail, sender, receiver, process_description)
detail = [detail,
- 'note right of cook',
- ' cooks burger',
+ "note right of #{receiver}",
+ " #{process_description}",
'end note'].join("\n")
end
end
class System