Class: ConferenceCallService::GetConferenceTemplateListResponse
- Inherits:
-
BasicResponse
- Object
- BasicResponse
- ConferenceCallService::GetConferenceTemplateListResponse
- Defined in:
- lib/conference_call_service/get_conference_template_list_response.rb
Instance Attribute Summary collapse
-
#template_ids ⇒ Object
Returns the value of attribute template_ids.
Attributes inherited from BasicResponse
Instance Method Summary collapse
-
#initialize(response_xml, raise_exception_on_error = true) ⇒ GetConferenceTemplateListResponse
constructor
Constructor.
- #to_s ⇒ Object
Methods inherited from BasicResponse
Constructor Details
#initialize(response_xml, raise_exception_on_error = true) ⇒ GetConferenceTemplateListResponse
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 |
# File 'lib/conference_call_service/get_conference_template_list_response.rb', line 12 def initialize(response_xml, raise_exception_on_error = true) @template_ids = [] doc = response_xml.document @error_code = ConferenceCallService.xpath_query(doc, "statusCode").to_s @error_message = ConferenceCallService.xpath_query(doc, "statusMessage").to_s ConferenceCallService.xpath_query(doc, "templateIds").each do |template_id_xml| @template_ids << template_id_xml.to_s end raise_on_error(response_xml) if raise_exception_on_error end |
Instance Attribute Details
#template_ids ⇒ Object
Returns the value of attribute template_ids.
6 7 8 |
# File 'lib/conference_call_service/get_conference_template_list_response.rb', line 6 def template_ids @template_ids end |
Instance Method Details
#to_s ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'lib/conference_call_service/get_conference_template_list_response.rb', line 27 def to_s ret = "#{@error_code.to_s}: #{@error_message.to_s}\n" ret += "Template ids:\n" @template_ids.each do |template_id| ret += "\t#{template_id.to_s}\n" end ret end |