class SAML2::Assertion

Attributes

statements[W]
subject[W]

Public Class Methods

new() click to toggle source
Calls superclass method
# File lib/saml2/assertion.rb, line 9
def initialize
  super
  @statements = []
  @conditions = Conditions.new
end

Public Instance Methods

attribute_statements() click to toggle source

@return [Array<AttributeStatement>]

# File lib/saml2/assertion.rb, line 43
def attribute_statements
  statements.select { |s| s.is_a?(AttributeStatement) }
end
authn_statements() click to toggle source

@return [Array<AuthnStatement]

# File lib/saml2/assertion.rb, line 38
def authn_statements
  statements.select { |s| s.is_a?(AuthnStatement) }
end
build(builder) click to toggle source

(see Base#build)

Calls superclass method
# File lib/saml2/assertion.rb, line 53
def build(builder)
  builder["saml"].Assertion(
    "xmlns:saml" => Namespaces::SAML
  ) do |assertion|
    super(assertion)

    subject.build(assertion)

    conditions&.build(assertion)

    statements.each { |stmt| stmt.build(assertion) }
  end
end
conditions() click to toggle source

@return [Conditions]

# File lib/saml2/assertion.rb, line 30
def conditions
  if !instance_variable_defined?(:@conditions) && xml
    @conditions = Conditions.from_xml(xml.at_xpath("saml:Conditions", Namespaces::ALL))
  end
  @conditions
end
from_xml(node) click to toggle source
Calls superclass method
# File lib/saml2/assertion.rb, line 15
def from_xml(node)
  super
  @statements = nil
  remove_instance_variable(:@conditions)
end
statements() click to toggle source

@return [Array<AuthnStatement, AttributeStatement>]

# File lib/saml2/assertion.rb, line 48
def statements
  @statements ||= load_object_array(xml, "saml:AuthnStatement|saml:AttributeStatement")
end
subject() click to toggle source

@return [Subject, nil]

# File lib/saml2/assertion.rb, line 22
def subject
  if xml && !instance_variable_defined?(:@subject)
    @subject = Subject.from_xml(xml.at_xpath("saml:Subject", Namespaces::ALL))
  end
  @subject
end