1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
|
# File 'lib/brick.rb', line 1851
def encrypt_and_sign(value, *args, expires_at: nil, expires_in: nil, purpose: nil)
encrypted = if method(:_encrypt).arity == 1
_encrypt(value) else
if args.last.is_a?(Hash)
expires_at ||= args.last[:expires_at]
expires_in ||= args.last[:expires_in]
purpose ||= args.last[:purpose]
end
_encrypt(value, expires_at: expires_at, expires_in: expires_in, purpose: purpose)
end
verifier.generate(encrypted)
end
|