Method: Async::Node#annotate

Defined in:
lib/async/node.rb

#annotate(annotation) ⇒ Object

Annotate the node with a description.



143
144
145
146
147
148
149
150
151
152
153
154
155
# File 'lib/async/node.rb', line 143

def annotate(annotation)
  if block_given?
    begin
      current_annotation = @annotation
      @annotation = annotation
      return yield
    ensure
      @annotation = current_annotation
    end
  else
    @annotation = annotation
  end
end