Module: Anise

Defined in:
lib/anise.rb,
lib/anise/version.rb,
lib/anise/annotative.rb,
lib/anise/annotations.rb,
lib/anise/annotations/store.rb,
lib/anise/annotative/methods.rb,
lib/anise/annotative/variables.rb,
lib/anise/annotative/attributes.rb

Overview

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

Defined Under Namespace

Modules: Annotations, Annotative

Class Method Summary collapse

Class Method Details

.const_missing(name) ⇒ Object



12
13
14
# File 'lib/anise/version.rb', line 12

def self.const_missing(name)
  [name.to_s.downcase] || super(name)
end

.metadataObject



4
5
6
7
8
9
# File 'lib/anise/version.rb', line 4

def self.
  @metadata ||= (
    require 'yaml'
    YAML.load(File.new(File.dirname(__FILE__) + '/../anise.yml'))
  )
end