Module: ProcessShared::DefineSingletonMethod
Instance Method Summary collapse
-
#define_singleton_method(sym, &block) ⇒ Object
This method was added in Ruby 1.9.x.
Instance Method Details
#define_singleton_method(sym, &block) ⇒ Object
This method was added in Ruby 1.9.x. Include this module for backwards compatibility.
This isn’t exactly compatible with the method in 1.9 which can take a Proc, Method, or a block. This only accepts a block.
8 9 10 11 |
# File 'lib/process_shared/define_singleton_method.rb', line 8 def define_singleton_method(sym, &block) eigenclass = class << self; self; end eigenclass.send(:define_method, sym, &block) end |