Class: Mediaflux::ScriptFileListInitRequest
- Defined in:
- app/models/mediaflux/script_file_list_init_request.rb
Instance Attribute Summary
Attributes inherited from Request
Class Method Summary collapse
-
.service ⇒ String
Specifies the Mediaflux service to use.
Instance Method Summary collapse
-
#initialize(session_token:, path:, session_user: nil) ⇒ ScriptFileListInitRequest
constructor
Constructor.
-
#result ⇒ Object
Returns the iterator that would be use to fetch the file list.
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:, path:, session_user: nil) ⇒ ScriptFileListInitRequest
Constructor
7 8 9 10 |
# File 'app/models/mediaflux/script_file_list_init_request.rb', line 7 def initialize(session_token:, path:, session_user: nil) super(session_token: session_token, session_user: session_user) @path = path end |
Class Method Details
.service ⇒ String
Specifies the Mediaflux service to use
14 15 16 |
# File 'app/models/mediaflux/script_file_list_init_request.rb', line 14 def self.service "asset.script.execute" end |
Instance Method Details
#result ⇒ Object
Returns the iterator that would be use to fetch the file list
19 20 21 22 23 24 |
# File 'app/models/mediaflux/script_file_list_init_request.rb', line 19 def result # Weird: the result comes as an XML inside the typical /response/reply/result nested_response = response_xml.xpath("/response/reply/result").text nested_xml = Nokogiri::XML.parse(nested_response) nested_xml.xpath("/result/iterator").text.to_i end |