Class: Github::Cache::Entry

Inherits:
Object
  • Object
show all
Includes:
Checks
Defined in:
app/github/cache.rb

Overview

A cache entry.

Instance Attribute Summary collapse

Instance Method Summary collapse

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_atObject

Returns the value of attribute expires_at.



16
17
18
# File 'app/github/cache.rb', line 16

def expires_at
  @expires_at
end

#valueObject

Returns the value of attribute value.



16
17
18
# File 'app/github/cache.rb', line 16

def value
  @value
end