Module: Doorkeeper::Models::Revocable

Included in:
AccessGrantMixin, AccessTokenMixin
Defined in:
lib/doorkeeper/models/concerns/revocable.rb

Instance Method Summary collapse

Instance Method Details

#revoke(clock = DateTime) ⇒ Object


4
5
6
# File 'lib/doorkeeper/models/concerns/revocable.rb', line 4

def revoke(clock = DateTime)
  update_attribute :revoked_at, clock.now
end

#revoked?Boolean

Returns:

  • (Boolean)

8
9
10
# File 'lib/doorkeeper/models/concerns/revocable.rb', line 8

def revoked?
  !!(revoked_at && revoked_at <= DateTime.now)
end