Class: SAML2::RequestedAuthnContext

Inherits:
Base
  • Object
show all
Defined in:
lib/saml2/requested_authn_context.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#xml

Instance Method Summary collapse

Methods inherited from Base

#decrypt, from_xml, #initialize, #inspect, load_object_array, load_string_array, lookup_qname, #to_s, #to_xml

Constructor Details

This class inherits a constructor from SAML2::Base

Instance Attribute Details

#class_refString+

Returns:

  • (String, Array<String>)


10
11
12
# File 'lib/saml2/requested_authn_context.rb', line 10

def class_ref
  @class_ref
end

#comparisonString?

Returns:

  • (String, nil)


8
9
10
# File 'lib/saml2/requested_authn_context.rb', line 8

def comparison
  @comparison
end

Instance Method Details

#build(builder) ⇒ void

This method returns an undefined value.

Serialize this object to XML, as part of a larger document

Parameters:

  • builder (Nokogiri::XML::Builder)

    The builder helper object to serialize to.



19
20
21
22
23
24
25
26
# File 'lib/saml2/requested_authn_context.rb', line 19

def build(builder)
  builder["samlp"].RequestedAuthnContext do |requested_authn_context|
    requested_authn_context.parent["Comparison"] = comparison.to_s if comparison
    Array(class_ref).each do |individual_class_ref|
      requested_authn_context["saml"].AuthnContextClassRef(individual_class_ref)
    end
  end
end

#from_xml(node) ⇒ void

This method returns an undefined value.

Parse an XML element into this object.

Parameters:

  • node (Nokogiri::XML::Element)


13
14
15
16
# File 'lib/saml2/requested_authn_context.rb', line 13

def from_xml(node)
  super
  @class_ref = load_string_array(node, "saml:AuthnContextClassRef")
end