class Functional::Memo::ClassMethods::Memoizer
@!visibility private
Attributes
cache[R]
function[R]
max_cache[R]
Public Class Methods
new(function, max_cache)
click to toggle source
Calls superclass method
# File lib/functional/memo.rb, line 40 def initialize(function, max_cache) super synchronize do @function = function @max_cache = max_cache @cache = {} end end
Public Instance Methods
max_cache?()
click to toggle source
# File lib/functional/memo.rb, line 48 def max_cache? max_cache > 0 && cache.size >= max_cache end