Class: Mediaflux::CollectionQueryRequest
- Inherits:
-
QueryRequest
- Object
- Request
- QueryRequest
- Mediaflux::CollectionQueryRequest
- Defined in:
- app/models/mediaflux/collection_query_request.rb
Instance Attribute Summary
Attributes inherited from QueryRequest
#action, #aql_query, #collection, #deep_search
Attributes inherited from Request
Instance Method Summary collapse
- #collections ⇒ Object
-
#initialize(session_token:, namespace: nil, action: "get-meta") ⇒ CollectionQueryRequest
constructor
A new instance of CollectionQueryRequest.
Methods inherited from QueryRequest
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, service, uri, #xml_payload, #xtoshell_xml
Constructor Details
#initialize(session_token:, namespace: nil, action: "get-meta") ⇒ CollectionQueryRequest
Returns a new instance of CollectionQueryRequest.
4 5 6 |
# File 'app/models/mediaflux/collection_query_request.rb', line 4 def initialize(session_token:, namespace: nil, action: "get-meta") super(session_token: session_token, namespace: namespace, aql_query: "asset is collection", action: action) end |
Instance Method Details
#collections ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'app/models/mediaflux/collection_query_request.rb', line 8 def collections xml = response_xml collection_assets = [] xml.xpath("/response/reply/result/asset").each do |node| collection_asset = { id: node.xpath("./@id").text, path: node.xpath("./path").text, name: node.xpath("./name").text, description: node.xpath("./description").text } collection_assets << collection_asset end collection_assets end |