Class: ConferenceCallService::GetConferenceStatusResponse

Inherits:
BasicResponse
  • Object
show all
Defined in:
lib/conference_call_service/get_conference_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

Constructor Details

#initialize(response_xml, raise_exception_on_error = true) ⇒ GetConferenceStatusResponse

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
28
29
30
31
# File 'lib/conference_call_service/get_conference_status_response.rb', line 12

def initialize(response_xml, raise_exception_on_error = true)

  @conference_ids = []
  @participants   = []

  doc = response_xml.document

  @error_code     = ConferenceCallService.xpath_query(doc, "statusCode").to_s
  @error_message  = ConferenceCallService.xpath_query(doc, "statusMessage").to_s

  @details        = ConferenceDetails.build_from_xml(ConferenceCallService.xpath_query(doc, "detail"))
  @schedule       = ConferenceSchedule.build_from_xml(ConferenceCallService.xpath_query(doc, "schedule"))

  participants_xml = ConferenceCallService.xpath_query(doc, "participants")
  participants_xml.each do |participant_xml|
    @participants << Participant.build_from_xml(participant_xml)
  end

  raise_on_error(response_xml) if raise_exception_on_error
end

Instance Attribute Details

#accObject

Returns the value of attribute acc.



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

def acc
  @acc
end

#detailsObject

Returns the value of attribute details.



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

def details
  @details
end

#participantsObject

Returns the value of attribute participants.



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

def participants
  @participants
end

#scheduleObject

Returns the value of attribute schedule.



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

def schedule
  @schedule
end

#start_timeObject

Returns the value of attribute start_time.



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

def start_time
  @start_time
end

Instance Method Details

#to_sObject



33
34
35
36
37
38
39
40
41
# File 'lib/conference_call_service/get_conference_status_response.rb', line 33

def to_s
  ret = "#{@error_code}: #{@error_message}\n"
  ret += "\t" + details.to_s + "\n" if details
  ret += "\t" + schedule.to_s + "\n" if schedule
  @participants.each do |participant|
    ret += "\t" + participant.to_s + "\n"
  end
  ret
end