Class: Puppet::Environments::Cached::MRUEntry Private

Inherits:
TTLEntry show all
Defined in:
lib/puppet/environments.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

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

Instance Attribute Summary

Attributes inherited from Entry

#value

Instance Method Summary collapse

Methods inherited from TTLEntry

#expired?

Methods inherited from Entry

#expired?, #guard, #guarded?, #unguard

Constructor Details

#initialize(value, ttl_seconds) ⇒ MRUEntry

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of MRUEntry.



592
593
594
595
596
# File 'lib/puppet/environments.rb', line 592

def initialize(value, ttl_seconds)
  super(value, ttl_seconds)

  touch
end

Instance Method Details

#labelObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



602
603
604
# File 'lib/puppet/environments.rb', line 602

def label
  "(mru = #{@ttl_seconds} sec)"
end

#touchObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



598
599
600
# File 'lib/puppet/environments.rb', line 598

def touch
  @ttl = Time.now + @ttl_seconds
end