Method: BOAST.pr_annotate

Defined in:
lib/BOAST/Language/Algorithm.rb

.pr_annotate(a) ⇒ Object

Annotates an Object by inlining a YAML structure in a comment. If object’s class is part of the annotate list an indepth version of the annotation will be generated.

Parameters:

  • object to annotate



149
150
151
152
153
154
155
156
157
158
159
# File 'lib/BOAST/Language/Algorithm.rb', line 149

def pr_annotate(a)
  name = a.class.name.gsub("BOAST::","")
  if annotate_list.include?(name) then
    description = nil
    if a.is_a?(Annotation) and a.annotate_indepth?(0) then
      description = a.annotation(0)
    end
    annotation = { "#{name}#{annotate_number(name)}" => description }
    Comment(YAML::dump(annotation)).pr
  end
end