Class: SRU::ExplainResponse
Instance Attribute Summary
Attributes inherited from Response
#doc, #namespaces, #parser
Instance Method Summary
collapse
Methods inherited from Response
#initialize
Methods included from XPath
#get_attribute, #xpath, #xpath_all, #xpath_first
Constructor Details
This class inherits a constructor from SRU::Response
Instance Method Details
#database ⇒ Object
19
20
21
|
# File 'lib/sru/explain.rb', line 19
def database
return xpath(@doc, './/ns0:serverInfo/ns0:database', @namespaces)
end
|
#host ⇒ Object
9
10
11
|
# File 'lib/sru/explain.rb', line 9
def host
return xpath(@doc,'.//ns0:serverInfo/ns0:host', @namespaces )
end
|
#number_of_records ⇒ Object
23
24
25
|
# File 'lib/sru/explain.rb', line 23
def number_of_records
return xpath(@doc, './/ns0:configInfo/ns0:numberOfRecords', @namespaces)
end
|
#port ⇒ Object
13
14
15
16
17
|
# File 'lib/sru/explain.rb', line 13
def port
port = xpath(@doc, './/ns0:serverInfo/ns0:port', @namespaces)
return nil if not port
return Integer(port)
end
|
#to_s ⇒ Object
5
6
7
|
# File 'lib/sru/explain.rb', line 5
def to_s
return "host=#{host} port=#{port} database=#{database} version=#{version}"
end
|
#version ⇒ Object
27
28
29
30
31
32
33
34
35
36
|
# File 'lib/sru/explain.rb', line 27
def version
version = xpath(@doc, './/zs:version', @namespaces)
return version if version
info = xpath(@doc, './/ns0:serverInfo', @namespaces)
return get_attribute(info, "version") if info
return nil
end
|