module Anise

Dynamic Annotations for Ruby.

require 'anise'

Provides annotations:

class X
  extend Anise::Annotations

  ann :foo, :class=>String
end

Provides method annotations:

class Y
  extend Anise::Annotator::Method

  def self.doc(string)
    method_annotation(:doc=>string)
  end

  doc "foo is cool"
  def foo
    # ...
  end
end

Provides annotated attributes:

class Z
  extend Anise::Annotator::Attribute

  attr :bar, Integer, :max=>10
end

Public Class Methods

const_missing(name) click to toggle source
Calls superclass method
# File lib/anise/version.rb, line 12
def self.const_missing(name)
  metadata[name.to_s.downcase] || super(name)
end
metadata() click to toggle source
# File lib/anise/version.rb, line 4
def self.metadata
  @metadata ||= (
    require 'yaml'
    YAML.load(File.new(File.dirname(__FILE__) + '/../anise.yml'))
  )
end