Class: Cachetastic::Cache::StoreObject

Inherits:
Object
  • Object
show all
Defined in:
lib/cachetastic/store_object.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

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_atObject

Returns the value of attribute expires_at.



5
6
7
# File 'lib/cachetastic/store_object.rb', line 5

def expires_at
  @expires_at
end

#keyObject

Returns the value of attribute key.



6
7
8
# File 'lib/cachetastic/store_object.rb', line 6

def key
  @key
end

#valueObject

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

Returns:

  • (Boolean)


15
16
17
# File 'lib/cachetastic/store_object.rb', line 15

def expired?
  return Time.now > self.expires_at
end

#inspectObject



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