Class: Puppet::Environments::Cached::TTLEntry Private
- 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.
Time to Live eviction policy entry
Instance Attribute Summary
Attributes inherited from Entry
Instance Method Summary collapse
- #expired? ⇒ Boolean private
- #expires ⇒ Object private
-
#initialize(value, ttl_seconds) ⇒ TTLEntry
constructor
private
A new instance of TTLEntry.
- #label ⇒ Object private
Constructor Details
#initialize(value, ttl_seconds) ⇒ TTLEntry
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 TTLEntry.
486 487 488 489 490 |
# File 'lib/puppet/environments.rb', line 486 def initialize(value, ttl_seconds) super value @ttl = Time.now + ttl_seconds @ttl_seconds = ttl_seconds end |
Instance Method Details
#expired? ⇒ Boolean
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.
492 493 494 |
# File 'lib/puppet/environments.rb', line 492 def expired? Time.now > @ttl end |
#expires ⇒ Object
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.
500 501 502 |
# File 'lib/puppet/environments.rb', line 500 def expires @ttl end |
#label ⇒ Object
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.
496 497 498 |
# File 'lib/puppet/environments.rb', line 496 def label "(ttl = #{@ttl_seconds} sec)" end |