Class: DNSCacheEntry
- Defined in:
- puppet/modules/wmflib/lib/puppet/parser/functions/ipresolve.rb
Instance Method Summary collapse
-
#initialize(entry, ttl) ⇒ DNSCacheEntry
constructor
Data structure for storing a DNS cached result.
- #valid?(time) ⇒ Boolean
- #value ⇒ Object
Constructor Details
#initialize(entry, ttl) ⇒ DNSCacheEntry
Data structure for storing a DNS cached result.
17 18 19 20 |
# File 'puppet/modules/wmflib/lib/puppet/parser/functions/ipresolve.rb', line 17 def initialize(entry, ttl) @value = entry @ttl = Time.now.to_i + ttl end |
Instance Method Details
#valid?(time) ⇒ Boolean
22 23 24 |
# File 'puppet/modules/wmflib/lib/puppet/parser/functions/ipresolve.rb', line 22 def valid?(time) @ttl > time end |
#value ⇒ Object
26 27 28 |
# File 'puppet/modules/wmflib/lib/puppet/parser/functions/ipresolve.rb', line 26 def value @value.to_s end |