Class: Casablanca::Cas_2_0_ResponseParser
- Inherits:
-
CasResponseParser
- Object
- CasResponseParser
- Casablanca::Cas_2_0_ResponseParser
- Defined in:
- lib/casablanca/response_parsers.rb
Instance Method Summary collapse
- #authenticated? ⇒ Boolean
- #failure_code ⇒ Object
- #failure_message ⇒ Object
-
#initialize(xml) ⇒ Cas_2_0_ResponseParser
constructor
A new instance of Cas_2_0_ResponseParser.
- #user ⇒ Object
Methods inherited from CasResponseParser
Constructor Details
#initialize(xml) ⇒ Cas_2_0_ResponseParser
Returns a new instance of Cas_2_0_ResponseParser.
21 22 23 24 |
# File 'lib/casablanca/response_parsers.rb', line 21 def initialize(xml) doc = REXML::Document.new(xml) @xml = doc.elements['cas:serviceResponse'].elements[1] end |
Instance Method Details
#authenticated? ⇒ Boolean
30 31 32 |
# File 'lib/casablanca/response_parsers.rb', line 30 def authenticated? @xml.name == 'authenticationSuccess' end |
#failure_code ⇒ Object
34 35 36 |
# File 'lib/casablanca/response_parsers.rb', line 34 def failure_code @xml.elements['//cas:authenticationFailure'].attributes['code'] end |
#failure_message ⇒ Object
38 39 40 |
# File 'lib/casablanca/response_parsers.rb', line 38 def strip_text(@xml.elements['//cas:authenticationFailure']) end |
#user ⇒ Object
26 27 28 |
# File 'lib/casablanca/response_parsers.rb', line 26 def user strip_text(@xml.elements['cas:user']) end |