Class: JWT::JWA::Wrapper Private

Inherits:
Object
  • Object
show all
Includes:
SigningAlgorithm
Defined in:
lib/jwt/jwa/wrapper.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Methods included from SigningAlgorithm

included, #raise_sign_error!, #raise_verify_error!

Constructor Details

#initialize(algorithm) ⇒ Wrapper

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.

Returns a new instance of Wrapper.


9
10
11
# File 'lib/jwt/jwa/wrapper.rb', line 9

def initialize(algorithm)
  @algorithm = algorithm
end

Instance Method Details

#algObject

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.


13
14
15
16
17
# File 'lib/jwt/jwa/wrapper.rb', line 13

def alg
  return @algorithm.alg if @algorithm.respond_to?(:alg)

  super
end

#header(*args, **kwargs) ⇒ 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.


25
26
27
28
29
# File 'lib/jwt/jwa/wrapper.rb', line 25

def header(*args, **kwargs)
  return @algorithm.header(*args, **kwargs) if @algorithm.respond_to?(:header)

  super
end

#sign(*args, **kwargs) ⇒ 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.


31
32
33
34
35
# File 'lib/jwt/jwa/wrapper.rb', line 31

def sign(*args, **kwargs)
  return @algorithm.sign(*args, **kwargs) if @algorithm.respond_to?(:sign)

  super
end

#valid_alg?(alg_to_check) ⇒ Boolean

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.

Returns:

  • (Boolean)

19
20
21
22
23
# File 'lib/jwt/jwa/wrapper.rb', line 19

def valid_alg?(alg_to_check)
  return @algorithm.valid_alg?(alg_to_check) if @algorithm.respond_to?(:valid_alg?)

  super
end

#verify(*args, **kwargs) ⇒ 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.


37
38
39
40
41
# File 'lib/jwt/jwa/wrapper.rb', line 37

def verify(*args, **kwargs)
  return @algorithm.verify(*args, **kwargs) if @algorithm.respond_to?(:verify)

  super
end