Class: JWT::JWA::Wrapper

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

Instance Method Summary collapse

Methods included from SigningAlgorithm

included, #raise_sign_error!, #raise_verify_error!

Constructor Details

#initialize(algorithm) ⇒ Wrapper

Returns a new instance of Wrapper.



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

def initialize(algorithm)
  @algorithm = algorithm
end

Instance Method Details

#algObject



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

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

  super
end

#header(*args, **kwargs) ⇒ Object



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

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

  super
end

#sign(*args, **kwargs) ⇒ Object



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

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

  super
end

#valid_alg?(alg_to_check) ⇒ Boolean

Returns:

  • (Boolean)


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

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



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

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

  super
end