class Puppet::Environments::Cached::MRUEntry

Policy that expires if it hasn't been touched within ttl_seconds

Public Class Methods

new(value, ttl_seconds) click to toggle source
    # File lib/puppet/environments.rb
581 def initialize(value, ttl_seconds)
582   super(value)
583   @ttl = Time.now + ttl_seconds
584   @ttl_seconds = ttl_seconds
585 
586   touch
587 end

Public Instance Methods

expired?(now) click to toggle source
    # File lib/puppet/environments.rb
593 def expired?(now)
594   now > @ttl
595 end
label() click to toggle source
    # File lib/puppet/environments.rb
597 def label
598   "(ttl = #{@ttl_seconds} sec)"
599 end
touch() click to toggle source
    # File lib/puppet/environments.rb
589 def touch
590   @ttl = Time.now + @ttl_seconds
591 end