Skip to content

Commit 7923e42

Browse files
hsbtmatzbot
authored andcommitted
[ruby/securerandom] Only define compatible method in < Ruby 3.3
ruby/securerandom@2c8cdfba7b
1 parent 3a4433d commit 7923e42

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

lib/securerandom.rb

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,9 @@ def bytes(n)
5353

5454
# Compatibility methods for Ruby 3.2, we can remove this after dropping to support Ruby 3.2
5555
def alphanumeric(n = nil, chars: ALPHANUMERIC)
56-
if RUBY_VERSION < '3.3'
57-
n = 16 if n.nil?
58-
choose(chars, n)
59-
else
60-
super n, chars: chars
61-
end
62-
end
56+
n = 16 if n.nil?
57+
choose(chars, n)
58+
end if RUBY_VERSION < '3.3'
6359

6460
private
6561

0 commit comments

Comments
 (0)