We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 85bf8c6 + e17c3f1 commit 86ddaaeCopy full SHA for 86ddaae
lib/global_id/signed_global_id.rb
@@ -72,6 +72,10 @@ def ==(other)
72
super && @purpose == other.purpose
73
end
74
75
+ def inspect # :nodoc:
76
+ "#<#{self.class.name}:#{'%#016x' % (object_id << 1)}>"
77
+ end
78
+
79
private
80
def pick_expiration(options)
81
return options[:expires_at] if options.key?(:expires_at)
test/cases/signed_global_id_test.rb
@@ -29,6 +29,10 @@ class SignedGlobalIDTest < ActiveSupport::TestCase
29
test 'to param' do
30
assert_equal @person_sgid.to_s, @person_sgid.to_param
31
32
33
+ test 'inspect' do
34
+ assert_match(/\A#<SignedGlobalID:0x[0-9a-f]+>\z/, @person_sgid.inspect)
35
36
37
38
class SignedGlobalIDPurposeTest < ActiveSupport::TestCase
0 commit comments