Module: Expirable
- Defined in:
- lib/mega/expirable.rb
Overview
:title: Expirable
Generic expiring functionality mixin.
Usage
TODO: If anyone has an example of using this please submit. -T
Author(s)
-
George Moschovitis
Instance Attribute Summary collapse
-
#expires ⇒ Object
Returns the value of attribute expires.
Instance Method Summary collapse
-
#expired? ⇒ Boolean
Is this entry expired?.
-
#expires_after(timeout = (60*60*24)) ⇒ Object
Set the expires timeout for this entry.
-
#expires_spread(base, spread) ⇒ Object
Set the expire timeout for this entry.
Instance Attribute Details
#expires ⇒ Object
Returns the value of attribute expires.
39 40 41 |
# File 'lib/mega/expirable.rb', line 39 def expires @expires end |
Instance Method Details
#expired? ⇒ Boolean
Is this entry expired?
56 57 58 59 60 61 62 |
# File 'lib/mega/expirable.rb', line 56 def expired? if @expires.nil? or (Time.now > @expires) return true else return false end end |