Class: ActiveRecord::CacheInstance
- Inherits:
-
Object
- Object
- ActiveRecord::CacheInstance
- Defined in:
- lib/cachear.rb
Instance Method Summary collapse
- #expire! ⇒ Object
- #expired? ⇒ Boolean
-
#initialize(inst) ⇒ CacheInstance
constructor
A new instance of CacheInstance.
- #instance ⇒ Object
Constructor Details
#initialize(inst) ⇒ CacheInstance
Returns a new instance of CacheInstance.
120 121 122 123 124 125 126 127 |
# File 'lib/cachear.rb', line 120 def initialize(inst) begin @inst = inst.dup rescue TypeError @inst = inst end @expired = false end |
Instance Method Details
#expire! ⇒ Object
137 138 139 140 |
# File 'lib/cachear.rb', line 137 def expire! @inst = nil @expired = true end |
#expired? ⇒ Boolean
142 143 144 |
# File 'lib/cachear.rb', line 142 def expired? @expired end |
#instance ⇒ Object
129 130 131 132 133 134 135 |
# File 'lib/cachear.rb', line 129 def instance begin @inst.dup rescue @inst end end |