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
571 def initialize(value, ttl_seconds)
572   super(value)
573   @ttl = Time.now + ttl_seconds
574   @ttl_seconds = ttl_seconds
575 
576   touch
577 end

Public Instance Methods

expired?(now) click to toggle source
    # File lib/puppet/environments.rb
583 def expired?(now)
584   now > @ttl
585 end
label() click to toggle source
    # File lib/puppet/environments.rb
587 def label
588   "(ttl = #{@ttl_seconds} sec)"
589 end
touch() click to toggle source
    # File lib/puppet/environments.rb
579 def touch
580   @ttl = Time.now + @ttl_seconds
581 end