Method: BiteScript::Annotatable#annotate

Defined in:
lib/bitescript/builder.rb,
lib/bitescript/asm3/builder.rb

#annotate(cls, runtime = nil) {|annotation| ... } ⇒ Object

Yields:

  • (annotation)


69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/bitescript/builder.rb', line 69

def annotate(cls, runtime=nil)
  if runtime.nil?
    retention = find_retention(cls)
    return if retention == 'SOURCE'
    runtime = retention == 'RUNTIME'
  end

  annotation = visit_annotation(Signature.ci(cls), runtime)
  annotation.extend AnnotationBuilder

  yield annotation
  annotation.visit_end
end