Class Anise::Annotations::Store
In: lib/anise/annotations/store.rb
Parent: Object

The {Annotations::Store} class tracks annotations on a per-class bases.

Methods

[]   ancestors   annotate   annotate!   local   lookup   new   update  

Public Class methods

Setup new Annotations instance.

@param space [Class,Module]

  Class or Module to have annotations.

Public Instance methods

Access to local table.

Ancestors of spaceal class/module.

Set or read annotations.

IMPORTANT! Do not use this for in-place modifications. Use annotate! instead.

@pararm ns [Symbol] Annotation namespace.

@param ref [Object] Annotation reference key.

@since 0.7.0

To change an annotation‘s value in place for a given class or module it first must be duplicated, otherwise the change may effect annotations in the class or module‘s ancestors.

@pararm ns [Symbol] Annotation namespace.

@param ref [Object] Annotation reference key.

@since 0.7.0

Annotations local to spaceal class/module.

Lookup an annotation. Unlike `self[ref]` this provides a complete annotation heritage, pulling annotations of the same reference name from ancestor classes and modules.

Unlike the other annotation methods, this method takes the `ref` argument before the `ns` argument. This is it allow `ns` to default to the common annotator `ann`.

@param ref [Object] Annotation reference key.

@param ns [Symbol] Annotation namespace.

Update annotations for a given namespace and reference.

[Validate]