Class | Object |
In: |
lib/attic.rb
|
Parent: | Object |
These methods are copied directly from _why‘s metaid.rb. See: whytheluckystiff.net/articles/seeingMetaclassesClearly.html
NOMETACLASS | = | [Symbol, Fixnum].freeze | An Array of classes which do not have metaclasses. |
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.
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.