Class: Puree::XMLExtractor::Server

Inherits:
Base
  • Object
show all
Defined in:
lib/puree/xml_extractor/server.rb

Overview

Server XML extractor.

Instance Method Summary collapse

Methods inherited from Base

#xpath_query_for_multi_value, #xpath_query_for_single_value

Constructor Details

#initialize(xml:) ⇒ Server

Returns a new instance of Server.



9
10
11
12
# File 'lib/puree/xml_extractor/server.rb', line 9

def initialize(xml:)
  @resource_type = :server
  super
end

Instance Method Details

#get_data?Boolean

Is there any data after get?

Returns:

  • (Boolean)


23
24
25
26
# File 'lib/puree/xml_extractor/server.rb', line 23

def get_data?
  # n.b. arbitrary element existence check
  version.empty? ? false : true
end

#versionString

Returns:

  • (String)


15
16
17
18
# File 'lib/puree/xml_extractor/server.rb', line 15

def version
  path = "#{service_response_name}/baseVersion"
  @doc.xpath(path).text.strip
end