Class: ConferenceCallService::GetParticipantStatusResponse

Inherits:
BasicResponse
  • Object
show all
Defined in:
lib/conference_call_service/get_participant_status_response.rb

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) ⇒ GetParticipantStatusResponse

Constructor.

Parameters

response_xml

Xml as returned by the corresponding method call.

raise_exception_on_error

Raise an exception if an error occurs or not?



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/conference_call_service/get_participant_status_response.rb', line 12

def initialize(response_xml, raise_exception_on_error = true)
  doc = response_xml.document
  @status = {}
  @error_code = ConferenceCallService.xpath_query(doc, "statusCode").to_s
  @error_message = ConferenceCallService.xpath_query(doc, "statusMessage").to_s

  status_xml = ConferenceCallService.xpath_query(doc, "status")
  if status_xml then
    status_xml.each do |one_status_xml|
      name = ConferenceCallService.xpath_query(one_status_xml, "name", false).to_s
      value = ConferenceCallService.xpath_query(one_status_xml, "value", false).to_s
      @status[name] = value 
    end                  
  end
  raise_on_error(response_xml) if raise_exception_on_error
end

Instance Attribute Details

#statusObject

Returns the value of attribute status.



6
7
8
# File 'lib/conference_call_service/get_participant_status_response.rb', line 6

def status
  @status
end