Module: Card::Cache::SharedClass
- Included in:
- Shared
- Defined in:
- lib/card/cache/shared_class.rb
Overview
class methods for Card::Cache::Shared
Instance Method Summary collapse
-
#new_stamp ⇒ Object
stamp generator.
- #renew ⇒ Object
- #reset ⇒ Object
- #stamp ⇒ Object
- #stamp_key ⇒ Object
Instance Method Details
#new_stamp ⇒ Object
stamp generator
10 11 12 |
# File 'lib/card/cache/shared_class.rb', line 10 def new_stamp Time.now.to_i.to_s(36) + rand(999).to_s(36) end |
#renew ⇒ Object
18 19 20 |
# File 'lib/card/cache/shared_class.rb', line 18 def renew @stamp = nil end |
#reset ⇒ Object
22 23 24 25 |
# File 'lib/card/cache/shared_class.rb', line 22 def reset @stamp = new_stamp Cardio.cache.write stamp_key, @stamp end |