Module: Doorkeeper::Models::Revocable
- Included in:
- AccessGrantMixin, AccessTokenMixin
- Defined in:
- lib/doorkeeper/models/concerns/revocable.rb
Instance Method Summary collapse
-
#revoke(clock = Time) ⇒ Object
Revokes the object (updates ‘:revoked_at` attribute setting its value to the specific time).
-
#revoked? ⇒ Boolean
Indicates whether the object has been revoked.
Instance Method Details
#revoke(clock = Time) ⇒ Object
Revokes the object (updates ‘:revoked_at` attribute setting its value to the specific time).
11 12 13 |
# File 'lib/doorkeeper/models/concerns/revocable.rb', line 11 def revoke(clock = Time) update_attribute(:revoked_at, clock.now.utc) end |
#revoked? ⇒ Boolean
Indicates whether the object has been revoked.
19 20 21 |
# File 'lib/doorkeeper/models/concerns/revocable.rb', line 19 def revoked? !!(revoked_at && revoked_at <= Time.now.utc) end |