In Files

Parent

Class Index [+]

Quicksearch

Object

Metaid == a few simple metaclass helper (See whytheluckystiff.net/articles/seeingMetaclassesClearly.html.)

Public Instance Methods

class_def(name, &blk) click to toggle source

Defines an instance method within a class

    # File metaid.rb, line 14
14:     def class_def name, &blk
15:         class_eval { define_method name, &blk }
16:     end
meta_def(name, &blk) click to toggle source

Adds methods to a metaclass

    # File metaid.rb, line 9
 9:     def meta_def name, &blk
10:         meta_eval { define_method name, &blk }
11:     end
meta_eval(&blk;) click to toggle source
   # File metaid.rb, line 6
6:     def meta_eval &blk; metaclass.instance_eval &blk; end
metaclass() click to toggle source

The hidden singleton lurks behind everyone

   # File metaid.rb, line 5
5:     def metaclass; class << self; self; end; end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.