module Crygen::Modules::Annotation

Overview

Module that is used to store and add the annotations.

Included Modules

Direct including types

Defined in:

modules/annotation.cr

Instance Method Summary

Instance methods inherited from module Crygen::Helpers::Annotation

always_inline : self always_inline, call_convention(name : String) : self call_convention, deprecated(message : String) : self
deprecated : self
deprecated
, experimental(message : String) : self
experimental : self
experimental
, extern : self extern, flags : self flags, link(name : String) : self link, no_inline : self no_inline, thread_local : self thread_local

Instance Method Detail

def 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

[View source]
def 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

[View source]