Class: Cachetastic::Cache::StoreObject
- Inherits:
-
Object
- Object
- Cachetastic::Cache::StoreObject
- Defined in:
- lib/cachetastic/store_object.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#expires_at ⇒ Object
Returns the value of attribute expires_at.
-
#key ⇒ Object
Returns the value of attribute key.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #expired? ⇒ Boolean
-
#initialize(key, value, expires_at) ⇒ StoreObject
constructor
A new instance of StoreObject.
- #inspect ⇒ Object
Constructor Details
#initialize(key, value, expires_at) ⇒ StoreObject
Returns a new instance of StoreObject.
9 10 11 12 13 |
# File 'lib/cachetastic/store_object.rb', line 9 def initialize(key, value, expires_at) self.key = key self.value = value self.expires_at = expires_at end |
Instance Attribute Details
#expires_at ⇒ Object
Returns the value of attribute expires_at.
5 6 7 |
# File 'lib/cachetastic/store_object.rb', line 5 def expires_at @expires_at end |
#key ⇒ Object
Returns the value of attribute key.
6 7 8 |
# File 'lib/cachetastic/store_object.rb', line 6 def key @key end |
#value ⇒ Object
Returns the value of attribute value.
7 8 9 |
# File 'lib/cachetastic/store_object.rb', line 7 def value @value end |
Instance Method Details
#expired? ⇒ Boolean
15 16 17 |
# File 'lib/cachetastic/store_object.rb', line 15 def expired? return Time.now > self.expires_at end |
#inspect ⇒ Object
19 20 21 |
# File 'lib/cachetastic/store_object.rb', line 19 def inspect "#<Cachetastic::Cache::StoreObject key='#{self.key}' expires_at='#{self.expires_at}' value='#{self.value}'>" end |