Module: Memoizable::ModuleMethods
- Includes:
- Memoizable
- Defined in:
- lib/memoizable/module_methods.rb
Overview
Methods mixed in to memoizable singleton classes
Constant Summary
Constants included from Memoizable
Instance Method Summary collapse
-
#freezer ⇒ #call
private
Return default deep freezer.
-
#memoize(*methods) ⇒ self
Memoize a list of methods.
-
#unmemoized_instance_method(name) ⇒ UnboundMethod
Return unmemoized instance method.
Methods included from InstanceMethods
Instance Method Details
#freezer ⇒ #call
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return default deep freezer
13 14 15 |
# File 'lib/memoizable/module_methods.rb', line 13 def freezer Freezer end |
#memoize(*methods) ⇒ self
Memoize a list of methods
28 29 30 31 |
# File 'lib/memoizable/module_methods.rb', line 28 def memoize(*methods) methods.each { |method| memoize_method(method) } self end |
#unmemoized_instance_method(name) ⇒ UnboundMethod
Return unmemoized instance method
56 57 58 |
# File 'lib/memoizable/module_methods.rb', line 56 def unmemoized_instance_method(name) memoized_methods[name].original_method end |