Sha256: 16298e9446a4db9148501b282be4943488fa623669a78c22e08ac4a45842690a
Contents?: true
Size: 467 Bytes
Versions: 20
Compression:
Stored size: 467 Bytes
Contents
module Doorkeeper module Models module Expirable def expired? expires_in && Time.now > expired_time end def expires_in_seconds return nil if expires_in.nil? expires = (created_at + expires_in.seconds) - Time.now expires_sec = expires.seconds.round(0) expires_sec > 0 ? expires_sec : 0 end private def expired_time created_at + expires_in.seconds end end end end
Version data entries
20 entries across 20 versions & 1 rubygems