Simple Annotations 4 Ruby

Simple method annotations like in java or Python methods decorators

GitHub

Documentation GitHub issues GitHub tag (latest by date) GitHub top language GitHub milestones

Gem Gem Version Twitter Follow GitHub Org's stars GitHub watchers

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