Method: Object#meta_def

Defined in:
lib/stump/metaid.rb

#meta_def(name, &blk) ⇒ Object

Adds methods to a metaclass



9
10
11
12
13
14
15
# File 'lib/stump/metaid.rb', line 9

def meta_def name, &blk
  meta_eval {
    define_method(name) {|*args, &block|
      blk.call(*args, &block)
    }
  }
end