Class: Mediaflux::CollectionCountRequest
- Defined in:
- app/models/mediaflux/collection_count_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
- #count ⇒ Object
-
#initialize(session_token:, namespace:, data_sponsor: nil, department: nil) ⇒ CollectionCountRequest
constructor
Constructor.
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:, namespace:, data_sponsor: nil, department: nil) ⇒ CollectionCountRequest
Constructor
9 10 11 12 13 14 |
# File 'app/models/mediaflux/collection_count_request.rb', line 9 def initialize(session_token:, namespace:, data_sponsor: nil, department: nil) super(session_token: session_token) @namespace = namespace @data_sponsor = data_sponsor @department = department end |
Class Method Details
.service ⇒ String
Specifies the Mediaflux service to use
18 19 20 |
# File 'app/models/mediaflux/collection_count_request.rb', line 18 def self.service "asset.count" end |
Instance Method Details
#count ⇒ Object
22 23 24 25 |
# File 'app/models/mediaflux/collection_count_request.rb', line 22 def count @count ||= response_xml.xpath("/response/reply/result/total").text @count end |