Class: PuppetLibrary::Http::Cache::InMemory::Entry

Inherits:
Object
  • Object
show all
Defined in:
lib/puppet_library/http/cache/in_memory.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ Entry

Returns a new instance of Entry.



53
54
55
56
# File 'lib/puppet_library/http/cache/in_memory.rb', line 53

def initialize(value)
    @birth = Time.now
    @value = value
end

Instance Attribute Details

#valueObject

Returns the value of attribute value.



51
52
53
# File 'lib/puppet_library/http/cache/in_memory.rb', line 51

def value
  @value
end

Instance Method Details

#age_millisObject



58
59
60
61
# File 'lib/puppet_library/http/cache/in_memory.rb', line 58

def age_millis
    age_seconds = Time.now - @birth
    age_seconds * 1000
end