Class: SAML2::Status
Constant Summary collapse
- SUCCESS =
"urn:oasis:names:tc:SAML:2.0:status:Success"
- REQUESTER =
"urn:oasis:names:tc:SAML:2.0:status:Requester"
- RESPONDER =
"urn:oasis:names:tc:SAML:2.0:status:Responder"
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.
-
#from_xml(node) ⇒ void
Parse an XML element into this object.
-
#initialize(code = SUCCESS, message = nil) ⇒ Status
constructor
A new instance of Status.
- #success? ⇒ Boolean
Methods inherited from Base
#decrypt, from_xml, #inspect, load_object_array, load_string_array, lookup_qname, #to_s, #to_xml
Constructor Details
#initialize(code = SUCCESS, message = nil) ⇒ Status
Returns a new instance of Status.
16 17 18 19 20 |
# File 'lib/saml2/status.rb', line 16 def initialize(code = SUCCESS, = nil) super() @code = code = end |
Instance Attribute Details
#code ⇒ String
12 13 14 |
# File 'lib/saml2/status.rb', line 12 def code @code end |
#message ⇒ String
12 13 14 |
# File 'lib/saml2/status.rb', line 12 def end |
Instance Method Details
#build(builder) ⇒ void
This method returns an undefined value.
Serialize this object to XML, as part of a larger document
34 35 36 37 38 39 40 41 |
# File 'lib/saml2/status.rb', line 34 def build(builder) builder["samlp"].Status do |status| status["samlp"].StatusCode(Value: code) Array().each do |m| status["samlp"].StatusMessage(m) end end end |
#from_xml(node) ⇒ void
This method returns an undefined value.
Parse an XML element into this object.
23 24 25 26 27 |
# File 'lib/saml2/status.rb', line 23 def from_xml(node) super self.code = node.at_xpath("samlp:StatusCode", Namespaces::ALL)["Value"] self. = load_string_array(xml, "samlp:StatusMessage") end |
#success? ⇒ Boolean
29 30 31 |
# File 'lib/saml2/status.rb', line 29 def success? code == SUCCESS end |