1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Unify rotate method definitions to take keyword arguments

This commit is contained in:
Akira Matsuda 2019-09-19 17:36:40 +09:00
parent a08a069acd
commit 491ab85207

View file

@ -9,14 +9,22 @@ module ActiveSupport
@signed, @encrypted = [], []
end
def rotate(kind, *args)
def rotate(kind, *args, **options)
case kind
when :signed
if options&.any?
@signed << (args << options)
else
@signed << args
end
when :encrypted
if options&.any?
@encrypted << (args << options)
else
@encrypted << args
end
end
end
end
end
end