module

Crygen::Modules::Annotation

Inherits Crygen::Helpers::Annotation

Module that is used to store and add the annotations.

Instance methods

add_annotation(annotation_type : Crygen::Types::Annotation) : self

Adds the annotation onto object. Example:

class_type = CGT::Class.new("Person")
class_type.add_annotation(CGT::Annotation.new("Experimental"))

Output:

@[Experimental]
class Person
end
Source
add_annotations(*annotation_type : Crygen::Types::Annotation) : self

Adds annotations onto object. Example:

class_type = CGT::Class.new("Person")
class_type.add_annotations(
  CGT::Annotation.new("Experimental"),
  CGT::Annotation.new("AnotherAnnotation")
)

Output:

@[Experimental]
@[AnotherAnnotation]
class Person
end
Source