Class: CacheKeeper::ReplaceMethod
- Inherits:
-
Object
- Object
- CacheKeeper::ReplaceMethod
- Defined in:
- lib/cache_keeper/replace_method.rb
Class Method Summary collapse
Class Method Details
.replace(cached_method, &block) ⇒ Object
5 6 7 8 9 10 11 12 |
# File 'lib/cache_keeper/replace_method.rb', line 5 def replace(cached_method, &block) klass = cached_method.klass method_name = cached_method.method_name alias_for_original_method = cached_method.alias_for_original_method original_visibility = visibility_method_name(klass, method_name) define_method_with_visibility klass, method_name, alias_for_original_method, original_visibility, &block end |