Class: Object

Inherits:
BasicObject
Defined in:
lib/funkr/compat/1.8.rb

Instance Method Summary collapse

Instance Method Details

#define_singleton_method(name, &block) ⇒ Object



42
43
44
45
46
47
# File 'lib/funkr/compat/1.8.rb', line 42

def define_singleton_method(name, &block)
  singleton = class << self; self end
  singleton.send(:define_method, name) do |*args|
    block.call(*args)
  end
end