# Facets / Annotations 2.0.0

**URL:** <https://www.ruby-forum.com/t/facets-annotations-2-0-0/88447>\
**Category:** Ruby\
**Created:** [March 11, 2007, 7:31am UTC](https://www.ruby-forum.com/t/facets-annotations-2-0-0/88447 "2007-03-11T07:31:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Trans](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/dfb087/32.png) [@Trans](https://www.ruby-forum.com/u/Trans)\
**Post date:** [March 11, 2007, 7:31am UTC](https://www.ruby-forum.com/t/facets-annotations-2-0-0/88447/1 "2007-03-11T07:31:59Z")

</div>

Facets / Annotations

A Complete In Code Annotations System  
by Trans and George M.

[http://facets.rubyforge.org](http://facets.rubyforge.org)

[S y n o p s i s]

Annotations provides a complete and easy to use system of annotating  
methods and arbitrary objects.The annotations are defined in-code, not  
in comments, so it is fully reflective without any preproccessing.

[W h a t ’ s N e w]

This is Facets/Annotations first release as an independent project. As  
with all Facets’ subprojects it is included in the complete facets  
package. So if you have ‘facets’ installed you do not need this.

Version 2.0+ is a major simplification over 1.0 series. Overall speed  
is much faster and the notation more consistant. Where before one  
would use “ann.attr\_name.ann\_name”, now it’s  
ann(:attr\_name, :ann\_name). This change was inspired by Ara T. Howard.

There are two libs, ann.rb provides the ann method and ann\_attr.rb  
augments the common attibute methods to handle annotations.

[E x a m p l e]

require 'facets/ann\_attr.rb

class X  
attr :foo, String, :default =\> “bar”  
end

X.ann :foo, :class #=\> String  
X.ann :foo, :default #=\> “bar”

X.ann :foo, :default =\> “baz”

X.ann :foo, :default #=\> “baz”

[I n s t a l l a t i o n]

IMPORTANT! This library is included in the complete facets package.  
You do not this library if you already have facets installed.

You can install either via gem or tarball.

gem install facets\_annotations

or

wget  
[http://rubyforge.org/frs/download.php/18317/facets\_annotations-2.0.0.tgz](http://rubyforge.org/frs/download.php/18317/facets_annotations-2.0.0.tgz)  
cd facets\_annotations  
sudo ruby setup.rb

[C r e d i t]

Trans [Implementation]  
George M. [Original Concept]  
Ara T. Howard [Suggestions]

[L i c e n s e]

Copyright (c) 2004-2007 Thomas S., George M.  
Distributed under the Ruby/GPL dual-license.

---

<div class="post-metadata">

**Author:** ![Trans](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/dfb087/32.png) [@Trans](https://www.ruby-forum.com/u/Trans)\
**Post date:** [March 13, 2007, 11:41pm UTC](https://www.ruby-forum.com/t/facets-annotations-2-0-0/88447/2 "2007-03-13T23:41:58Z")

</div>

Sorry, I overlooked a dependency for the annotations package. Should  
have it fixed tomorrow.

T.
