Class: CallStatusResponse

Inherits:
BasicResponse show all
Defined in:
lib/voice_call_service/call_status_response.rb

Overview

Represents a response for a voice call operation, such as new_call ot the VoiceCallService.

Instance Attribute Summary collapse

Attributes inherited from BasicResponse

#error_code, #error_message

Instance Method Summary collapse

Methods inherited from BasicResponse

#inizialize, #raise_on_error, #to_s

Constructor Details

#initialize(response_xml, raise_exception_on_error = true) ⇒ CallStatusResponse

Constructor.

Parameters

response_xml

Xml as returned by a call_status-method call.

raise_exception_on_error

Xml as returned by a call_status-method call.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/voice_call_service/call_status_response.rb', line 14

def initialize(response_xml, raise_exception_on_error = true)
  doc = response_xml.document

  @error_code      = doc.xpath("//status").text
  @error_message   = doc.xpath("//err_msg").text
  @session_id      = doc.xpath("//sessionId").text
  @connection_time_a = doc.xpath("//connectiontimea").text
  @connection_time_b = doc.xpath("//connectiontimeb").text
  @description_a = doc.xpath("//descriptiona").text
  @description_b = doc.xpath("//descriptionb").text
  @reason_a = doc.xpath("//reasona").text
  @reason_b = doc.xpath("//reasonb").text
  @state_a = doc.xpath("//statea").text
  @state_b = doc.xpath("//stateb").text

  raise_on_error(response_xml) if raise_exception_on_error
end

Instance Attribute Details

#connection_time_aObject

Returns the value of attribute connection_time_a.



7
8
9
# File 'lib/voice_call_service/call_status_response.rb', line 7

def connection_time_a
  @connection_time_a
end

#connection_time_bObject

Returns the value of attribute connection_time_b.



7
8
9
# File 'lib/voice_call_service/call_status_response.rb', line 7

def connection_time_b
  @connection_time_b
end

#description_aObject

Returns the value of attribute description_a.



7
8
9
# File 'lib/voice_call_service/call_status_response.rb', line 7

def description_a
  @description_a
end

#description_bObject

Returns the value of attribute description_b.



7
8
9
# File 'lib/voice_call_service/call_status_response.rb', line 7

def description_b
  @description_b
end

#reason_aObject

Returns the value of attribute reason_a.



7
8
9
# File 'lib/voice_call_service/call_status_response.rb', line 7

def reason_a
  @reason_a
end

#reason_bObject

Returns the value of attribute reason_b.



7
8
9
# File 'lib/voice_call_service/call_status_response.rb', line 7

def reason_b
  @reason_b
end

#state_aObject

Returns the value of attribute state_a.



8
9
10
# File 'lib/voice_call_service/call_status_response.rb', line 8

def state_a
  @state_a
end

#state_bObject

Returns the value of attribute state_b.



8
9
10
# File 'lib/voice_call_service/call_status_response.rb', line 8

def state_b
  @state_b
end