class JWT::Encode
Public Class Methods
new(options)
click to toggle source
Initializes a new Encode
instance.
@param options [Hash] the options for encoding the JWT
token. @option options [Hash] :payload the payload of the JWT
token. @option options [Hash] :headers the headers of the JWT
token. @option options [String] :key the key used to sign the JWT
token. @option options [String] :algorithm the algorithm used to sign the JWT
token.
# File lib/jwt/encode.rb, line 15 def initialize(options) @token = Token.new(payload: options[:payload], header: options[:headers]) @key = options[:key] @algorithm = options[:algorithm] end