Class: Aegis::Util

Inherits:
Object
  • Object
show all
Defined in:
lib/aegis/util.rb

Class Method Summary collapse

Class Method Details

.define_class_method(object, method, &body) ⇒ Object



5
6
7
8
# File 'lib/aegis/util.rb', line 5

def define_class_method(object, method, &body)
  prototype = object.respond_to?(:singleton_class) ? object.singleton_class : object.metaclass
  prototype.send(:define_method, method, &body)
end