Class: PuppetX::Wmflib::DNS::CacheEntry
- Defined in:
- modules/wmflib/lib/puppet_x/wmflib/dns.rb
Instance Method Summary collapse
-
#initialize(entry, ttl) ⇒ CacheEntry
constructor
Data structure for storing a DNS cached result.
- #valid?(time) ⇒ Boolean
- #value ⇒ Object
Constructor Details
#initialize(entry, ttl) ⇒ CacheEntry
Data structure for storing a DNS cached result.
21 22 23 24 |
# File 'modules/wmflib/lib/puppet_x/wmflib/dns.rb', line 21 def initialize(entry, ttl) @value = entry @ttl = Time.now.to_i + ttl end |
Instance Method Details
#valid?(time) ⇒ Boolean
26 27 28 |
# File 'modules/wmflib/lib/puppet_x/wmflib/dns.rb', line 26 def valid?(time) @ttl > time end |
#value ⇒ Object
30 31 32 |
# File 'modules/wmflib/lib/puppet_x/wmflib/dns.rb', line 30 def value @value.to_s end |