Class Object
In: lib/attic.rb
Parent: Object

Object

These methods are copied directly from _why‘s metaid.rb. See: whytheluckystiff.net/articles/seeingMetaclassesClearly.html

Methods

Constants

NOMETACLASS = [Symbol, Fixnum].freeze   An Array of classes which do not have metaclasses.

Public Instance methods

Add a class method called name for the current object‘s class. This isn‘t so special but it maintains consistency with meta_def.

Add an instance method called name to metaclass for the current object. This is useful because it will be available as a singleton method to all subclasses too.

Execute a block +&blk+ within the metaclass of the current object.

A convenient method for getting the metaclass of the current object. i.e.

    class << self; self; end;

NOTE: Some Ruby class do not have meta classes (see: NOMETACLASS). For these classes, this method returns the class itself. That means the instance variables will stored in the class itself.

A convenient method for getting the metaclass of the metaclass i.e.

    self.metaclass.metaclass

[Validate]