Module: Covercache::DefiningHelper
- Defined in:
- lib/covercache.rb
Overview
Defining Helper
Instance Method Summary collapse
- #class_define_cached(method, *args, &block) ⇒ Object
-
#define_cached(method, *args, &block) ⇒ Object
Define and wrap methods or blocks.
Instance Method Details
#class_define_cached(method, *args, &block) ⇒ Object
129 130 131 132 133 |
# File 'lib/covercache.rb', line 129 def class_define_cached(method, *args, &block) = args. [:is_class_method] = true self.send :define_cached, method, *args, , &block end |
#define_cached(method, *args, &block) ⇒ Object
Define and wrap methods or blocks
118 119 120 121 122 123 124 125 126 127 |
# File 'lib/covercache.rb', line 118 def define_cached(method, *args, &block) = args. is_class_method = !!.delete(:is_class_method) file, line = caller[is_class_method ? 1 : 0].split ':', 2 line = line.to_i covercache_method_arguments method, args, , &block covercache_define_wrapper method, file, line, is_class_method end |