Module: Expirable
- Defined in:
- lib/mixers/expirable.rb
Overview
Expirable
Generic expirability mixin.
Instance Attribute Summary collapse
-
#expiration ⇒ Object
Returns the value of attribute expiration.
Instance Method Summary collapse
-
#expired? ⇒ Boolean
Is this entry expired?.
-
#touch! ⇒ Object
Update the expiration period.
Instance Attribute Details
#expiration ⇒ Object
Returns the value of attribute expiration.
7 8 9 |
# File 'lib/mixers/expirable.rb', line 7 def expiration @expiration end |
Instance Method Details
#expired? ⇒ Boolean
Is this entry expired?
27 28 29 30 31 |
# File 'lib/mixers/expirable.rb', line 27 def expired? return true if expiration.nil? return true if (Time.now > expiration) return false end |
#touch! ⇒ Object
Update the expiration period. Override in your application.
34 35 |
# File 'lib/mixers/expirable.rb', line 34 def touch! end |