Class: JWT::Claims::Numeric
- Inherits:
-
Object
- Object
- JWT::Claims::Numeric
- Defined in:
- lib/jwt/claims/numeric.rb
Overview
The Numeric class is responsible for validating numeric claims in a JWT token. The numeric claims are: exp, iat and nbf
Defined Under Namespace
Classes: Compat
Class Method Summary collapse
- .new(*args) ⇒ Object private
-
.verify!(payload:, **_args) ⇒ nil
deprecated
Deprecated.
The ::JWT::Claims::Numeric.verify! method will be removed in the next major version of ruby-jwt
Instance Method Summary collapse
-
#verify!(context:) ⇒ nil
Verifies the numeric claims in the JWT context.
Class Method Details
.new(*args) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
30 31 32 33 34 35 |
# File 'lib/jwt/claims/numeric.rb', line 30 def self.new(*args) return super if args.empty? Deprecations.warning('Calling ::JWT::Claims::Numeric.new with the payload will be removed in the next major version of ruby-jwt') Compat.new(*args) end |
.verify!(payload:, **_args) ⇒ nil
Deprecated.
The ::JWT::Claims::Numeric.verify! method will be removed in the next major version of ruby-jwt
Verifies the numeric claims in the JWT payload.
53 54 55 56 |
# File 'lib/jwt/claims/numeric.rb', line 53 def self.verify!(payload:, **_args) Deprecations.warning('The ::JWT::Claims::Numeric.verify! method will be removed in the next major version of ruby-jwt.') JWT::Claims.verify_payload!(payload, :numeric) end |
Instance Method Details
#verify!(context:) ⇒ nil
Verifies the numeric claims in the JWT context.
42 43 44 |
# File 'lib/jwt/claims/numeric.rb', line 42 def verify!(context:) validate_numeric_claims(context.payload) end |