Methods mixed in to memoizable instances
Freeze the object
@example
object.freeze # object is now frozen
@return [Object]
@api public
# File lib/memoizable/instance_methods.rb, line 15 def freeze memoized_method_cache # initialize method cache super end
Sets a memoized value for a method
@example
object.memoize(hash: 12345)
@param [Hash{Symbol => Object}] data
the data to memoize
@return [self]
@api public
# File lib/memoizable/instance_methods.rb, line 31 def memoize(data) data.each { |name, value| memoized_method_cache[name] = value } self end
Generated with the Darkfish Rdoc Generator 2.