class TimedCache
def initialize(timeout, &block)
@timeout = timeout
@block = block
@cached_at = Time.now
end
def clear(force = false)
if force || @cached_at < @timeout.call()
@block.call()
true
else
false