Module: Adamantium::ModuleMethods
- Defined in:
- lib/adamantium/module_methods.rb
Overview
Methods mixed in to adamantium modules
Instance Method Summary collapse
-
#freezer ⇒ Freezer::Deep
private
Return default deep freezer.
-
#included(mod) ⇒ self
private
Hook called when module is included.
-
#memoize(*methods) ⇒ self
Memoize a list of methods.
-
#original_instance_method(name) ⇒ UnboundMethod
Return original instance method.
Instance Method Details
#freezer ⇒ Freezer::Deep
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
27 28 29 |
# File 'lib/adamantium/module_methods.rb', line 27 def freezer Freezer::Deep end |
#included(mod) ⇒ self
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.
Hook called when module is included
16 17 18 19 |
# File 'lib/adamantium/module_methods.rb', line 16 def included(mod) Adamantium.included(mod) self end |
#memoize(*methods) ⇒ self
Memoize a list of methods
42 43 44 45 46 47 |
# File 'lib/adamantium/module_methods.rb', line 42 def memoize(*methods) = methods.last.kind_of?(Hash) ? methods.pop : {} method_freezer = Freezer.parse() || freezer methods.each { |method| memoize_method(method, method_freezer) } self end |
#original_instance_method(name) ⇒ UnboundMethod
Return original instance method
74 75 76 |
# File 'lib/adamantium/module_methods.rb', line 74 def original_instance_method(name) memoized_methods[name] end |