Class: VoiceCallResponse
- Inherits:
-
BasicResponse
- Object
- BasicResponse
- VoiceCallResponse
- Defined in:
- lib/voice_call_service/voice_call_response.rb
Overview
Represents a response for a voice call operation, such as new_call
ot the VoiceCallService.
Instance Attribute Summary collapse
-
#session_id ⇒ Object
Returns the value of attribute session_id.
Attributes inherited from BasicResponse
Instance Method Summary collapse
-
#initialize(response_xml, raise_exception_on_error = true) ⇒ VoiceCallResponse
constructor
Constructor.
Methods inherited from BasicResponse
#inizialize, #raise_on_error, #to_s
Constructor Details
#initialize(response_xml, raise_exception_on_error = true) ⇒ VoiceCallResponse
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.
13 14 15 16 17 18 19 20 21 |
# File 'lib/voice_call_service/voice_call_response.rb', line 13 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 raise_on_error(response_xml) if raise_exception_on_error end |
Instance Attribute Details
#session_id ⇒ Object
Returns the value of attribute session_id.
7 8 9 |
# File 'lib/voice_call_service/voice_call_response.rb', line 7 def session_id @session_id end |