Class: CallStatusResponse
- Inherits:
-
BasicResponse
- Object
- BasicResponse
- CallStatusResponse
- 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
-
#be164 ⇒ Object
Returns the value of attribute be164.
-
#bindex ⇒ Object
Returns the value of attribute bindex.
-
#connection_time_a ⇒ Object
Returns the value of attribute connection_time_a.
-
#connection_time_b ⇒ Object
Returns the value of attribute connection_time_b.
-
#description_a ⇒ Object
Returns the value of attribute description_a.
-
#description_b ⇒ Object
Returns the value of attribute description_b.
-
#reason_a ⇒ Object
Returns the value of attribute reason_a.
-
#reason_b ⇒ Object
Returns the value of attribute reason_b.
-
#state_a ⇒ Object
Returns the value of attribute state_a.
-
#state_b ⇒ Object
Returns the value of attribute state_b.
Attributes inherited from BasicResponse
Instance Method Summary collapse
-
#initialize(response_xml, raise_exception_on_error = true) ⇒ CallStatusResponse
constructor
Constructor.
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 31 32 33 |
# 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").to_s @error_message = doc.xpath("//err_msg").to_s @session_id = doc.xpath("//sessionId").to_s @connection_time_a = doc.xpath("//connectiontimea").to_s @connection_time_b = doc.xpath("//connectiontimeb").to_s @description_a = doc.xpath("//descriptiona").to_s @description_b = doc.xpath("//descriptionb").to_s @reason_a = doc.xpath("//reasona").to_s @reason_b = doc.xpath("//reasonb").to_s @state_a = doc.xpath("//statea").to_s @state_b = doc.xpath("//stateb").to_s @be164 = doc.xpath("//be164").to_s @bindex = doc.xpath("//bindex").to_s raise_on_error(response_xml) if raise_exception_on_error end |
Instance Attribute Details
#be164 ⇒ Object
Returns the value of attribute be164.
8 9 10 |
# File 'lib/voice_call_service/call_status_response.rb', line 8 def be164 @be164 end |
#bindex ⇒ Object
Returns the value of attribute bindex.
8 9 10 |
# File 'lib/voice_call_service/call_status_response.rb', line 8 def bindex @bindex end |
#connection_time_a ⇒ Object
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_b ⇒ Object
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_a ⇒ Object
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_b ⇒ Object
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_a ⇒ Object
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_b ⇒ Object
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_a ⇒ Object
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_b ⇒ Object
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 |