Sha256: 7381e4fb062012f4d4420f9b3cdcb2fcada6f62e24cd84898dfcbfe454e597fb
Contents?: true
Size: 478 Bytes
Versions: 43
Compression:
Stored size: 478 Bytes
Contents
class ProconBypassMan::Procon class FlipCache def self.fetch(key: , expires_in: , &block) if expires_in.nil? block.call else @@previous_flips_at_table[key] ||= Time.now if @@previous_flips_at_table[key] < Time.now @@previous_flips_at_table[key] = Time.now + expires_in block.call end end end # for testing def self.reset! @@previous_flips_at_table = {} end reset! end end
Version data entries
43 entries across 43 versions & 1 rubygems