module Virgil::Jwt::Validation

Public Class Methods

check_array_argument!(val) click to toggle source
# File lib/virgil/jwt/validation.rb, line 38
def self.check_array_argument!(val)
  raise TypeError, 'argument must be an array' unless val.is_a?(Array)

  val
end
check_filled_array_argument!(val) click to toggle source
# File lib/virgil/jwt/validation.rb, line 44
def self.check_filled_array_argument!(val)
  check_array_argument!(val)
  raise ArgumentError, 'argument must not be an empty array' if val.empty?

  val
end
check_type_argument!(cclass, val) click to toggle source
# File lib/virgil/jwt/validation.rb, line 51
def self.check_type_argument!(cclass, val)
  raise TypeError, "argument must have type #{cclass.name}" unless val.is_a?(cclass)

  val
end