Class: SimpleJwtAuth::Claims
- Inherits:
-
Object
- Object
- SimpleJwtAuth::Claims
- Includes:
- Traits::Configurable
- Defined in:
- lib/simple_jwt_auth/claims.rb
Instance Method Summary collapse
-
#initialize ⇒ Claims
constructor
A new instance of Claims.
- #merge(other_hash) ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize ⇒ Claims
Returns a new instance of Claims.
7 8 9 |
# File 'lib/simple_jwt_auth/claims.rb', line 7 def initialize @now = Time.now.to_i end |
Instance Method Details
#merge(other_hash) ⇒ Object
11 12 13 |
# File 'lib/simple_jwt_auth/claims.rb', line 11 def merge(other_hash) to_h.merge(other_hash) end |
#to_h ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/simple_jwt_auth/claims.rb', line 15 def to_h { iat: @now, exp: @now + config.exp_seconds, iss: config.issuer } end |