Class: RPCMapper::Cacheable::Entry
- Inherits:
-
Object
- Object
- RPCMapper::Cacheable::Entry
- Defined in:
- lib/rpc_mapper/cacheable/entry.rb
Instance Attribute Summary collapse
-
#expire_at ⇒ Object
Returns the value of attribute expire_at.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #expired? ⇒ Boolean
-
#initialize(value, expire_at) ⇒ Entry
constructor
A new instance of Entry.
Constructor Details
#initialize(value, expire_at) ⇒ Entry
Returns a new instance of Entry.
7 8 9 10 |
# File 'lib/rpc_mapper/cacheable/entry.rb', line 7 def initialize(value, expire_at) self.value = value self.expire_at = expire_at end |
Instance Attribute Details
#expire_at ⇒ Object
Returns the value of attribute expire_at.
5 6 7 |
# File 'lib/rpc_mapper/cacheable/entry.rb', line 5 def expire_at @expire_at end |
#value ⇒ Object
Returns the value of attribute value.
5 6 7 |
# File 'lib/rpc_mapper/cacheable/entry.rb', line 5 def value @value end |
Instance Method Details
#expired? ⇒ Boolean
12 13 14 |
# File 'lib/rpc_mapper/cacheable/entry.rb', line 12 def expired? Time.now > self.expire_at rescue true end |