Class: LiveEnsure::SessionStatusResponse
- Inherits:
-
Response
- Object
- Response
- LiveEnsure::SessionStatusResponse
show all
- Defined in:
- lib/live_ensure/session_status_response.rb
Instance Method Summary
collapse
Methods inherited from Response
#initialize
Instance Method Details
#failed? ⇒ Boolean
32
33
34
|
# File 'lib/live_ensure/session_status_response.rb', line 32
def failed?
@hash['message'] == 'FAILED'
end
|
#parse_other ⇒ Object
21
22
23
24
25
26
|
# File 'lib/live_ensure/session_status_response.rb', line 21
def parse_other
@response_lines.each do |line|
key, val = line.split(':').map(&:strip)
@hash[key] = val
end
end
|
#parse_response ⇒ Object
10
11
12
13
14
|
# File 'lib/live_ensure/session_status_response.rb', line 10
def parse_response
@response_lines = @response.split("\n")
parse_token
parse_other
end
|
#parse_token ⇒ Object
16
17
18
19
|
# File 'lib/live_ensure/session_status_response.rb', line 16
def parse_token
split_line = @response_lines.shift.split(':')
@hash['token'] = split_line[1]
end
|
#undetermined? ⇒ Boolean
36
37
38
|
# File 'lib/live_ensure/session_status_response.rb', line 36
def undetermined?
@hash['message'] == 'SESSION_UNDETERMINED'
end
|
#valid? ⇒ Boolean
28
29
30
|
# File 'lib/live_ensure/session_status_response.rb', line 28
def valid?
@hash['message'] == 'SUCCESS'
end
|