Class: SAML2::Subject::Confirmation
Defined Under Namespace
Modules: Methods
Instance Attribute Summary collapse
- #in_response_to ⇒ String?
- #method ⇒ String
- #not_before ⇒ Time?
- #not_on_or_after ⇒ Time?
- #recipient ⇒ String?
Attributes inherited from Base
Instance Method Summary collapse
-
#build(builder) ⇒ void
Serialize this object to XML, as part of a larger document.
-
#from_xml(node) ⇒ void
Parse an XML element into this object.
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
#in_response_to ⇒ String?
68 69 70 |
# File 'lib/saml2/subject.rb', line 68 def in_response_to @in_response_to end |
#method ⇒ String
64 65 66 |
# File 'lib/saml2/subject.rb', line 64 def method @method end |
#not_before ⇒ Time?
66 67 68 |
# File 'lib/saml2/subject.rb', line 66 def not_before @not_before end |
#not_on_or_after ⇒ Time?
66 67 68 |
# File 'lib/saml2/subject.rb', line 66 def not_on_or_after @not_on_or_after end |
#recipient ⇒ String?
68 69 70 |
# File 'lib/saml2/subject.rb', line 68 def recipient @recipient end |
Instance Method Details
#build(builder) ⇒ void
This method returns an undefined value.
Serialize this object to XML, as part of a larger document
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/saml2/subject.rb', line 84 def build(builder) builder["saml"].SubjectConfirmation("Method" => method) do |subject_confirmation| if in_response_to || recipient || not_before || not_on_or_after subject_confirmation["saml"].SubjectConfirmationData do |subject_confirmation_data| subject_confirmation_data.parent["NotBefore"] = not_before.iso8601 if not_before subject_confirmation_data.parent["NotOnOrAfter"] = not_on_or_after.iso8601 if not_on_or_after subject_confirmation_data.parent["Recipient"] = recipient if recipient subject_confirmation_data.parent["InResponseTo"] = in_response_to if in_response_to end end end end |
#from_xml(node) ⇒ void
This method returns an undefined value.
Parse an XML element into this object.
71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/saml2/subject.rb', line 71 def from_xml(node) super self.method = node["Method"] confirmation_data = node.at_xpath("saml:SubjectConfirmationData", Namespaces::ALL) return unless confirmation_data self.not_before = Time.parse(confirmation_data["NotBefore"]) if confirmation_data["NotBefore"] self.not_on_or_after = Time.parse(confirmation_data["NotOnOrAfter"]) if confirmation_data["NotOnOrAfter"] self.recipient = confirmation_data["Recipient"] self.in_response_to = confirmation_data["InResponseTo"] end |