lib/checkpoint/credential/token.rb in checkpoint-1.0.3 vs lib/checkpoint/credential/token.rb in checkpoint-1.1.0
- old
+ new
@@ -1,13 +1,13 @@
# frozen_string_literal: true
module Checkpoint
class Credential
# A Credential::Token is an identifier object for a Credential. It includes
- # a type and an identifier. A {Permit} can be granted for a Token. Concrete
+ # a type and an identifier. A {Grant} can be created for a Token. Concrete
# actions are resolved into a number of credentials, and those credentials'
- # tokens will be checked for matching permits.
+ # tokens will be checked for matching grants.
class Token
attr_reader :type, :id
# Create a new Credential representing a permission or instrument that
# represents multiple permissions.
@@ -40,9 +40,14 @@
# Compare with another Credential for equality. Consider them to represent
# the same credential if `other` is a credential, has the same type, and same id.
def eql?(other)
other.is_a?(Token) && type == other.type && id == other.id
+ end
+
+ # @return [Integer] hash code based on to_s
+ def hash
+ to_s.hash
end
alias == eql?
alias inspect uri
end