Class: CASino::AuthTokenTicket

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
ModelConcern::ConsumableTicket, ModelConcern::Ticket
Defined in:
app/models/casino/auth_token_ticket.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.cleanupObject


7
8
9
# File 'app/models/casino/auth_token_ticket.rb', line 7

def self.cleanup
  delete_all(['created_at < ?', CASino.config.auth_token_ticket[:lifetime].seconds.ago])
end

Instance Method Details

#expired?Boolean

Returns:

  • (Boolean)

11
12
13
# File 'app/models/casino/auth_token_ticket.rb', line 11

def expired?
  (Time.now - (self.created_at || Time.now)) > CASino.config.auth_token_ticket[:lifetime].seconds
end