Class: Token
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Token
- Defined in:
- lib/tokens/token.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.clean ⇒ Object
7 8 9 |
# File 'lib/tokens/token.rb', line 7 def self.clean where("expires_at < ? AND expires_at IS NOT NULL", Time.now).delete_all end |
Instance Method Details
#data ⇒ Object
11 12 13 |
# File 'lib/tokens/token.rb', line 11 def data read_attribute(:data) || {} end |
#expired? ⇒ Boolean
19 20 21 |
# File 'lib/tokens/token.rb', line 19 def expired? expires_at && expires_at < Time.now end |
#to_s ⇒ Object
15 16 17 |
# File 'lib/tokens/token.rb', line 15 def to_s token end |