Class: VoiceCallResponse

Inherits:
BasicResponse show all
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

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) ⇒ 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").text
  @error_message   = doc.xpath("//err_msg").text
  @session_id      = doc.xpath("//sessionId").text
  
  raise_on_error(response_xml) if raise_exception_on_error
end

Instance Attribute Details

#session_idObject

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