Class: Casablanca::CasResponseParser

Inherits:
Object
  • Object
show all
Defined in:
lib/casablanca/response_parsers.rb

Direct Known Subclasses

Cas_2_0_ResponseParser

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.parse(ticket, body) ⇒ Object

Raises:



8
9
10
11
12
13
14
15
16
17
# File 'lib/casablanca/response_parsers.rb', line 8

def self.parse(ticket, body)
  raise ResponseError, "Response body is empty" if body.nil? || body.strip == ""
  #return Cas_1_0_Parser.new(body) if ?
  response = Cas_2_0_ResponseParser.new(body)
  ticket.user = response.user      
  unless response.authenticated?
    ticket.failure_code = response.failure_code
    ticket.failure_message = response.failure_message
  end
end

Instance Method Details

#protocolObject



4
5
6
# File 'lib/casablanca/response_parsers.rb', line 4

def protocol
  self.class.to_s.gsub(/(Casablanca::Cas_|_ResponseParser)/, '').gsub('_', '.').to_f
end