Class: Github::Cache::Entry
- Inherits:
-
Object
- Object
- Github::Cache::Entry
- Includes:
- Checks
- Defined in:
- app/github/cache.rb
Overview
A cache entry.
Instance Attribute Summary collapse
-
#expires_at ⇒ Object
Returns the value of attribute expires_at.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(value, max_age_seconds) ⇒ Entry
constructor
A new instance of Entry.
Methods included from Checks
#check_boolean, #check_enumerable_of, #check_is_a, #check_non_empty_string, #check_non_nil, #check_positive_integer
Constructor Details
#initialize(value, max_age_seconds) ⇒ Entry
Returns a new instance of Entry.
18 19 20 21 |
# File 'app/github/cache.rb', line 18 def initialize(value, max_age_seconds) @value = check_non_nil(value: value) @expires_at = Time.now + check_positive_integer(max_age_seconds: max_age_seconds) end |
Instance Attribute Details
#expires_at ⇒ Object
Returns the value of attribute expires_at.
16 17 18 |
# File 'app/github/cache.rb', line 16 def expires_at @expires_at end |
#value ⇒ Object
Returns the value of attribute value.
16 17 18 |
# File 'app/github/cache.rb', line 16 def value @value end |