Class: Mediaflux::VersionRequest

Inherits:
Request
  • Object
show all
Defined in:
app/models/mediaflux/version_request.rb

Instance Attribute Summary

Attributes inherited from Request

#session_token

Class Method Summary collapse

Instance Method Summary collapse

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:) ⇒ VersionRequest

Constructor

Parameters:

  • session_token (String)

    the API token for the authenticated session



6
7
8
# File 'app/models/mediaflux/version_request.rb', line 6

def initialize(session_token:)
  super(session_token: session_token)
end

Class Method Details

.serviceString

Specifies the Mediaflux service to use when querying the version

Returns:

  • (String)


12
13
14
# File 'app/models/mediaflux/version_request.rb', line 12

def self.service
  "server.version"
end

Instance Method Details

#versionObject



16
17
18
19
20
21
22
# File 'app/models/mediaflux/version_request.rb', line 16

def version
  xml = response_xml
  {
    vendor: xml.xpath("/response/reply/result/vendor").text,
    version: xml.xpath("/response/reply/result/version").text
  }
end