Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/initializers/define_singleton_method.rb
Instance Method Summary collapse
Instance Method Details
#define_singleton_method(name, &block) ⇒ Object
28 29 30 31 32 |
# File 'lib/initializers/define_singleton_method.rb', line 28 def define_singleton_method name, &block self.instance_eval do (class << self; self; end).send :define_method, name, &block end end |