Class: SAML2::NameID
Defined Under Namespace
Modules: Format Classes: Policy
Instance Attribute Summary collapse
Attributes inherited from Base
Instance Method Summary collapse
- #==(other) ⇒ Boolean
-
#build(builder, element: nil) ⇒ void
Serialize this object to XML, as part of a larger document.
-
#from_xml(node) ⇒ void
Parse an XML element into this object.
-
#initialize(id = nil, format = nil, name_qualifier: nil, sp_name_qualifier: nil) ⇒ NameID
constructor
A new instance of NameID.
Methods inherited from Base
#decrypt, from_xml, #inspect, load_object_array, load_string_array, lookup_qname, #to_s, #to_xml
Constructor Details
#initialize(id = nil, format = nil, name_qualifier: nil, sp_name_qualifier: nil) ⇒ NameID
Returns a new instance of NameID.
94 95 96 97 98 99 100 |
# File 'lib/saml2/name_id.rb', line 94 def initialize(id = nil, format = nil, name_qualifier: nil, sp_name_qualifier: nil) super() @id = id @format = format @name_qualifier = name_qualifier @sp_name_qualifier = sp_name_qualifier end |
Instance Attribute Details
#format ⇒ String?
80 81 82 |
# File 'lib/saml2/name_id.rb', line 80 def format @format end |
#id ⇒ String
78 79 80 |
# File 'lib/saml2/name_id.rb', line 78 def id @id end |
#name_qualifier ⇒ String?
80 81 82 |
# File 'lib/saml2/name_id.rb', line 80 def name_qualifier @name_qualifier end |
#sp_name_qualifier ⇒ String?
80 81 82 |
# File 'lib/saml2/name_id.rb', line 80 def sp_name_qualifier @sp_name_qualifier end |
Instance Method Details
#==(other) ⇒ Boolean
104 105 106 107 108 109 |
# File 'lib/saml2/name_id.rb', line 104 def ==(other) id == other.id && format == other.format && name_qualifier == other.name_qualifier && sp_name_qualifier == other.sp_name_qualifier end |
#build(builder, element: nil) ⇒ void
This method returns an undefined value.
Serialize this object to XML, as part of a larger document
112 113 114 115 116 117 118 |
# File 'lib/saml2/name_id.rb', line 112 def build(builder, element: nil) args = {} args["Format"] = format if format args["NameQualifier"] = name_qualifier if name_qualifier args["SPNameQualifier"] = sp_name_qualifier if sp_name_qualifier builder["saml"].__send__(element || "NameID", id, args) end |
#from_xml(node) ⇒ void
This method returns an undefined value.
Parse an XML element into this object.
83 84 85 86 87 88 |
# File 'lib/saml2/name_id.rb', line 83 def from_xml(node) self.id = node.content.strip self.format = node["Format"] self.name_qualifier = node["NameQualifier"] self.sp_name_qualifier = node["SPNameQualifier"] end |