Class: DNSCacheEntry

Inherits:
Object show all
Defined in:
modules/wmflib/lib/puppet/parser/functions/ipresolve.rb

Instance Method Summary collapse

Constructor Details

#initialize(entry, ttl) ⇒ DNSCacheEntry

Data structure for storing a DNS cached result.



17
18
19
20
# File '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

Returns:

  • (Boolean)


22
23
24
# File 'modules/wmflib/lib/puppet/parser/functions/ipresolve.rb', line 22

def valid?(time)
  @ttl > time
end

#valueObject



26
27
28
# File 'modules/wmflib/lib/puppet/parser/functions/ipresolve.rb', line 26

def value
  @value.to_s
end