Sha256: 69c5c304faaa6020bc79dd012aa4cc45e1a775d847f6b02de0bf43923c2d02cb

Contents?: true

Size: 580 Bytes

Versions: 23

Compression:

Stored size: 580 Bytes

Contents

# frozen_string_literal: true

module Doorkeeper
  module Models
    module Revocable
      # Revokes the object (updates `:revoked_at` attribute setting its value
      # to the specific time).
      #
      # @param clock [Time] time object
      #
      def revoke(clock = Time)
        update_attribute(:revoked_at, clock.now.utc)
      end

      # Indicates whether the object has been revoked.
      #
      # @return [Boolean] true if revoked, false in other case
      #
      def revoked?
        !!(revoked_at && revoked_at <= Time.now.utc)
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
doorkeeper-5.8.1 lib/doorkeeper/models/concerns/revocable.rb
doorkeeper-5.8.0 lib/doorkeeper/models/concerns/revocable.rb
doorkeeper-5.7.1 lib/doorkeeper/models/concerns/revocable.rb
doorkeeper-5.7.0 lib/doorkeeper/models/concerns/revocable.rb
doorkeeper-5.6.9 lib/doorkeeper/models/concerns/revocable.rb
doorkeeper-5.6.8 lib/doorkeeper/models/concerns/revocable.rb
doorkeeper-5.6.7 lib/doorkeeper/models/concerns/revocable.rb
doorkeeper-5.6.6 lib/doorkeeper/models/concerns/revocable.rb
doorkeeper-5.6.5 lib/doorkeeper/models/concerns/revocable.rb
doorkeeper-5.6.4 lib/doorkeeper/models/concerns/revocable.rb
doorkeeper-5.6.3 lib/doorkeeper/models/concerns/revocable.rb
doorkeeper-5.6.2 lib/doorkeeper/models/concerns/revocable.rb
doorkeeper-5.6.1 lib/doorkeeper/models/concerns/revocable.rb
doorkeeper-5.6.0 lib/doorkeeper/models/concerns/revocable.rb
doorkeeper-5.6.0.rc2 lib/doorkeeper/models/concerns/revocable.rb
doorkeeper-5.6.0.rc1 lib/doorkeeper/models/concerns/revocable.rb
doorkeeper-5.5.4 lib/doorkeeper/models/concerns/revocable.rb
doorkeeper-5.5.3 lib/doorkeeper/models/concerns/revocable.rb
doorkeeper-5.5.2 lib/doorkeeper/models/concerns/revocable.rb
doorkeeper-5.5.1 lib/doorkeeper/models/concerns/revocable.rb