Class: Object

Inherits:
BasicObject
Defined in:
lib/atom/element.rb

Overview

cribbed from metaid.rb

Instance Method Summary collapse

Instance Method Details

#meta_def(name, &blk) ⇒ Object

Adds methods to a metaclass



21
22
23
# File 'lib/atom/element.rb', line 21

def meta_def name, &blk
  meta_eval { define_method name, &blk }
end

#meta_eval(&blk) ⇒ Object



18
# File 'lib/atom/element.rb', line 18

def meta_eval &blk; metaclass.instance_eval &blk; end

#metaclassObject

The hidden singleton lurks behind everyone



17
# File 'lib/atom/element.rb', line 17

def metaclass; class << self; self; end; end