Module: MetaProgramming::Object

Defined in:
lib/meta_programming/object.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/meta_programming/object.rb', line 3

def self.included(base)
  raise 'This module may only be included in class Object' unless base.name == 'Object'
  base.extend(ClassMethods)
  base.class_eval do
    alias_method :metaclass, :eigenclass
  end
end

Instance Method Details

#eigenclassObject



11
12
13
# File 'lib/meta_programming/object.rb', line 11

def eigenclass
  class << self; self; end
end