Class: Analysand::SessionResponse
- Defined in:
- lib/analysand/session_response.rb
Overview
Public: Wraps the response from GET /_session.
GET /_session can be a bit surprising. A 200 OK response from _session indicates that the session cookie was well-formed; it doesn’t indicate that the session is valid.
Hence, this class adds a #valid? predicate.
Instance Attribute Summary
Attributes inherited from Response
Instance Method Summary collapse
Methods inherited from Response
Methods included from StatusCodePredicates
#code, #conflict?, #not_found?, #success?, #unauthorized?
Methods included from ResponseHeaders
#cookies, #etag, #session_cookie
Constructor Details
This class inherits a constructor from Analysand::Response
Instance Method Details
#valid? ⇒ Boolean
12 13 14 |
# File 'lib/analysand/session_response.rb', line 12 def valid? (uc = body['userCtx']) && uc['name'] end |