Class: Mediaflux::IteratorDestroyRequest
- Defined in:
- app/models/mediaflux/iterator_destroy_request.rb
Instance Attribute Summary
Attributes inherited from Request
Class Method Summary collapse
-
.service ⇒ String
Specifies the Mediaflux service to use when running a query.
Instance Method Summary collapse
-
#initialize(session_token:, iterator:) ⇒ IteratorDestroyRequest
constructor
Constructor.
-
#result ⇒ Object
Returns empty string if iterator was destroyed, error message otherwise.
Methods inherited from Request
build_post_request, default_xml_namespace, default_xml_namespace_uri, #error?, find_or_create_http_client, format_date_for_mediaflux, request_path, #resolve, #resolved?, #response_body, #response_error, #response_xml, uri, #xml_payload, #xtoshell_xml
Constructor Details
#initialize(session_token:, iterator:) ⇒ IteratorDestroyRequest
Constructor
7 8 9 10 |
# File 'app/models/mediaflux/iterator_destroy_request.rb', line 7 def initialize(session_token:, iterator:) super(session_token: session_token) @iterator = iterator end |
Class Method Details
.service ⇒ String
Specifies the Mediaflux service to use when running a query
14 15 16 |
# File 'app/models/mediaflux/iterator_destroy_request.rb', line 14 def self.service "asset.query.iterator.destroy" end |
Instance Method Details
#result ⇒ Object
Returns empty string if iterator was destroyed, error message otherwise. Notice that once have run through an iterator Mediaflux destroys it automatically so it is possible to get an error indicating that an iterator does not exist if Mediaflux deleted it on its own.
22 23 24 25 |
# File 'app/models/mediaflux/iterator_destroy_request.rb', line 22 def result xml = response_xml xml.xpath("/response/reply['error']").text end |