Class: Contracts::DecodedTokenHeader

Inherits:
Object
  • Object
show all
Defined in:
lib/custom_contracts.rb

Class Method Summary collapse

Class Method Details

.to_sObject



121
122
123
# File 'lib/custom_contracts.rb', line 121

def self.to_s
  'A valid decoded token header attribute'
end

.valid?(val) ⇒ Boolean

Returns:

  • (Boolean)


117
118
119
# File 'lib/custom_contracts.rb', line 117

def self.valid?(val)
  C::HashOf[C::Enum['typ', 'alg'] => C::Or['JWT', C::TokenAlgorithm]].valid?(val)
end