Module: Philiprehberger::Memo::ClassMethods

Defined in:
lib/philiprehberger/memo.rb

Overview

Class-level memo method

Instance Method Summary collapse

Instance Method Details

#memo(method_name, ttl: nil, max_size: nil) ⇒ Object

Memoize a method by argument values

Parameters:

  • method_name (Symbol)

    the method to memoize

  • ttl (Numeric, nil) (defaults to: nil)

    time-to-live in seconds

  • max_size (Integer, nil) (defaults to: nil)

    max cache entries (LRU eviction)



23
24
25
# File 'lib/philiprehberger/memo.rb', line 23

def memo(method_name, ttl: nil, max_size: nil)
  Wrapper.apply(self, method_name, ttl: ttl, max_size: max_size)
end