Class: SAML::Core::Assertion

Inherits:
Object
  • Object
show all
Defined in:
lib/saml/core/assertion.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeAssertion

Returns a new instance of Assertion.



17
18
19
# File 'lib/saml/core/assertion.rb', line 17

def initialize
  @authn_statements = []
end

Instance Attribute Details

#attribute_statementObject (readonly)

Returns the value of attribute attribute_statement.



11
12
13
# File 'lib/saml/core/assertion.rb', line 11

def attribute_statement
  @attribute_statement
end

#authn_statementsObject (readonly)

Returns the value of attribute authn_statements.



12
13
14
# File 'lib/saml/core/assertion.rb', line 12

def authn_statements
  @authn_statements
end

#conditionsObject (readonly)

Returns the value of attribute conditions.



13
14
15
# File 'lib/saml/core/assertion.rb', line 13

def conditions
  @conditions
end

#idObject (readonly)

Returns the value of attribute id.



5
6
7
# File 'lib/saml/core/assertion.rb', line 5

def id
  @id
end

#issue_instantObject (readonly)

Returns the value of attribute issue_instant.



7
8
9
# File 'lib/saml/core/assertion.rb', line 7

def issue_instant
  @issue_instant
end

#issuerObject (readonly)

Returns the value of attribute issuer.



8
9
10
# File 'lib/saml/core/assertion.rb', line 8

def issuer
  @issuer
end

#subjectObject (readonly)

Returns the value of attribute subject.



10
11
12
# File 'lib/saml/core/assertion.rb', line 10

def subject
  @subject
end

#versionObject (readonly)

Returns the value of attribute version.



6
7
8
# File 'lib/saml/core/assertion.rb', line 6

def version
  @version
end

Class Method Details

.from_xml(xml) ⇒ Object



15
# File 'lib/saml/core/assertion.rb', line 15

def self.from_xml(xml); new.from_xml(xml); end

Instance Method Details

#from_xml(xml) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/saml/core/assertion.rb', line 21

def from_xml(xml)
  @id            = xml.attributes['ID']
  @version       = xml.attributes['Version']
  @issue_instant = xml.attributes['IssueInstant']
  
  subject_element = xml.get_elements('saml:Subject')
  unless subject_element.empty?
    # @subject = Subject.from_xml(subject_element.first)
  end

  attribute_statements = xml.get_elements('saml:AttributeStatement')
  unless attribute_statements.empty?
    @attribute_statement = AttributeStatement.from_xml(attribute_statements.first)
  end

  xml.get_elements('saml:AuthnStatement').each do |as|
    @authn_statements << AuthnStatement.from_xml(as)
  end

  self
end