Module: Mongoid::Extensions::Module
- Defined in:
- lib/mongoid/extensions/module.rb
Overview
Adds type-casting behavior to Module class.
Instance Method Summary collapse
-
#re_define_method(name, &block) ⇒ Method
Redefine the method.
Instance Method Details
#re_define_method(name, &block) ⇒ Method
Redefine the method. Will undef the method if it exists or simply just define it.
22 23 24 25 |
# File 'lib/mongoid/extensions/module.rb', line 22 def re_define_method(name, &block) undef_method(name) if method_defined?(name) define_method(name, &block) end |