jwt_claims v0.0.3 JwtClaims.StringOrUri

Validation helpers

Summary

Functions

A string is blank if it is empty or contains whitespaces only

A string is present if it is not blank

Predicate to compare two strings for equality, and that both are present

Functions

blank?(string)

A string is blank if it is empty or contains whitespaces only

Example

iex> StringOrUri.blank?(" ")
true

Returns true or false

cf. rails activesupport/lib/active_support/core_ext/object/blank.rb

present?(string)

A string is present if it is not blank

Returns false if a string is blank, otherwise true

present_and_equal?(a, b)

Predicate to compare two strings for equality, and that both are present

Example

iex> StringOrUri.present_and_equal?("", "")
false

Returns true or false