Class: Object

Inherits:
BasicObject
Defined in:
lib/core_ext/object.rb

Instance Method Summary collapse

Instance Method Details

#meta_def(sym, &block) ⇒ Object



10
11
12
13
14
# File 'lib/core_ext/object.rb', line 10

def meta_def(sym, &block)
  meta_eval do
    define_method(sym, &block)
  end
end

#meta_eval(&block) ⇒ Object



6
7
8
# File 'lib/core_ext/object.rb', line 6

def meta_eval(&block)
  metaclass.instance_eval(&block)
end

#metaclassObject



2
3
4
# File 'lib/core_ext/object.rb', line 2

def metaclass
  class << self; self end
end