class Saml::Attributes

Overview

SAML2 Attributes. Parse the Attributes from the AttributeStatement of the SAML Response.

Included Modules

Defined in:

saml/attributes.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(attrs : Hash(String, Array(AttributeValue)) = {} of String => Array(AttributeValue)) #

@param attrs [Hash] attribute names to arrays of values


[View source]

Instance Method Detail

def ==(other : Attributes) #

[View source]
def [](name) : Array(AttributeValue) | Nil #

All values of the attribute, nil when it is missing.


[View source]
def []=(name, values : Array(AttributeValue)) #

[View source]
def add(name, values : Array(AttributeValue) = [] of AttributeValue) #

[View source]
def all : Hash(String, Array(AttributeValue)) #

@return [Hash] Return all attributes as a hash


[View source]
def attributes : Hash(String, Array(AttributeValue)) #

[View source]
def each(& : Tuple(String, Array(AttributeValue)) -> ) #
Description copied from module Enumerable({String, Array(String?)})

Must yield this collection's elements to the block.


[View source]
def fetch(name : String | Symbol | Regex) : Array(AttributeValue) | Nil #

Fetch attribute value using name or regex


[View source]
def includes?(name) : Bool #

Test attribute presence by name


[View source]
def multi(name) : Array(AttributeValue) | Nil #

Return all values for an attribute


[View source]
def set(name, values : Array(AttributeValue)) #

[View source]
def single(name) : AttributeValue #

Return first value for an attribute


[View source]
def to_h : Hash(String, Array(String)) #

Name to non-nil values, as plain strings.


[View source]