Class: SAML2::Subject
Defined Under Namespace
Classes: Confirmation
Instance Attribute Summary collapse
Attributes inherited from Base
Instance Method Summary collapse
-
#build(builder) ⇒ void
Serialize this object to XML, as part of a larger document.
- #confirmation ⇒ Confirmation?
- #confirmation=(value) ⇒ Confirmation?
-
#from_xml(node) ⇒ void
Parse an XML element into this object.
-
#initialize ⇒ Subject
constructor
A new instance of Subject.
Methods inherited from Base
#decrypt, from_xml, #inspect, load_object_array, load_string_array, lookup_qname, #to_s, #to_xml
Constructor Details
#initialize ⇒ Subject
Returns a new instance of Subject.
10 11 12 13 |
# File 'lib/saml2/subject.rb', line 10 def initialize super @confirmations = [] end |
Instance Attribute Details
#confirmations ⇒ Confirmation+
41 42 43 |
# File 'lib/saml2/subject.rb', line 41 def confirmations @confirmations ||= load_object_array(xml, "saml:SubjectConfirmation", Confirmation) end |
#name_id ⇒ NameID
22 23 24 25 26 27 |
# File 'lib/saml2/subject.rb', line 22 def name_id if xml && !instance_variable_defined?(:@name_id) @name_id = NameID.from_xml(xml.at_xpath("saml:NameID", Namespaces::ALL)) end @name_id end |
Instance Method Details
#build(builder) ⇒ void
This method returns an undefined value.
Serialize this object to XML, as part of a larger document
46 47 48 49 50 51 52 53 |
# File 'lib/saml2/subject.rb', line 46 def build(builder) builder["saml"].Subject do |subject| name_id&.build(subject) Array(confirmations).each do |confirmation| confirmation.build(subject) end end end |
#confirmation ⇒ Confirmation?
30 31 32 |
# File 'lib/saml2/subject.rb', line 30 def confirmation Array.wrap(confirmations).first end |
#confirmation=(value) ⇒ Confirmation?
35 36 37 38 |
# File 'lib/saml2/subject.rb', line 35 def confirmation=(value) @confirmations = value.nil? ? [] : [value] confirmation end |
#from_xml(node) ⇒ void
This method returns an undefined value.
Parse an XML element into this object.
16 17 18 19 |
# File 'lib/saml2/subject.rb', line 16 def from_xml(node) super @confirmations = nil end |