Class: SAML::Core::Status

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#status_codeObject (readonly)

Returns the value of attribute status_code.



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

def status_code
  @status_code
end

Class Method Details

.from_xml(xml) ⇒ Object

FIXME attr_reader :status_message FIXME attr_reader :status_detail



9
# File 'lib/saml/core/status.rb', line 9

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

Instance Method Details

#from_xml(xml) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/saml/core/status.rb', line 11

def from_xml(xml)
  @status_code = REXML::XPath.first(
    xml,
    "//samlp:Status/samlp:StatusCode/@Value", 
    { 'samlp' => 'urn:oasis:names:tc:SAML:2.0:protocol'}
  ).value
  self
end

#success?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/saml/core/status.rb', line 20

def success?
  @status_code == 'urn:oasis:names:tc:SAML:2.0:status:Success'
end