Module: Puppet::Util::Cacher::Expirer

Included in:
Resource::Catalog, Puppet::Util::Cacher
Defined in:
lib/puppet/util/cacher.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#timestamp ⇒ Object (readonly)

Returns the value of attribute timestamp.



5
6
7
# File 'lib/puppet/util/cacher.rb', line 5

def timestamp
  @timestamp
end

Instance Method Details

#dependent_data_expired?(ts) ⇒ Boolean

Is the provided timestamp earlier than our expiration timestamp? If it is, then the associated value is expired.

Returns:

  • (Boolean)


14
15
16
17
18
# File 'lib/puppet/util/cacher.rb', line 14

def dependent_data_expired?(ts)
  return false unless timestamp

  timestamp > ts
end

#expire ⇒ Object

Cause all cached values to be considered expired.



8
9
10
# File 'lib/puppet/util/cacher.rb', line 8

def expire
  @timestamp = Time.now
end