Simple Annotations 4 Ruby
Simple method annotations like in java or Python methods decorators
Installation
Install it yourself as:
$ gem install carioca
Usage
Adding annotations to a class
require 'rubygems'
require 'simple-annotations'
class A
using AnnotationRefinement
annotate!
Display
{:test=>"string"}
Getting fields
require 'rubygems'
require 'simple-annotations'
class A
using AnnotationRefinement
annotate!
Display
{:test=>1234, :foobar=>{:color=>"cyan"}, :testbar=>[10, {}, [], "string"], :barfoo=>true, :footest=>"string"}
Defining Hooks
Supporting 2 Hooks :
- §after
- §before
Like :
require 'rubygems'
require 'simple-annotations'
class A
using AnnotationRefinement
annotate!
Display
before
test
after