class MemoizeUntil

Constants

TYPE_FACTORY

Public Class Methods

add_to(kind, key) click to toggle source

Adds a purpose at runtime for the specified kind.

@param kind [Symbol] one of the default or customised kind supported @param key [Symbol] the purpose defined in memoize_until.yml or :default.

@example Memoizing per day.

MemoizeUntil.add_to(:day, :runtime_key)

@return {}

# File lib/memoize_until/base.rb, line 47
def self.add_to(kind, key)
  TYPE_FACTORY[kind].add(key)
end
clear_now_for(kind, key) click to toggle source

clears previously memoized value for “now” for the given key only clears memory in the process that this code runs on. added for supporting custom scripts / test cases

@param kind [Symbol] one of the default or customised kind supported @param key [Symbol] the purpose defined in memoize_until.yml or :default.

@example Clearing currently memoised value for today for :default.

MemoizeUntil.clear_for(:day, :default)

@return nil

# File lib/memoize_until/base.rb, line 62
def self.clear_now_for(kind, key)
  TYPE_FACTORY[kind].clear_now(key)
end