Class: SRU::Response
Overview
base class for all SRU responses
Direct Known Subclasses
Instance Attribute Summary collapse
-
#doc ⇒ Object
readonly
Returns the value of attribute doc.
-
#namespaces ⇒ Object
readonly
Returns the value of attribute namespaces.
-
#parser ⇒ Object
readonly
Returns the value of attribute parser.
Instance Method Summary collapse
-
#initialize(doc, parser = 'rexml') ⇒ Response
constructor
A new instance of Response.
Methods included from XPath
#get_attribute, #xpath, #xpath_all, #xpath_first
Constructor Details
#initialize(doc, parser = 'rexml') ⇒ Response
Returns a new instance of Response.
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/sru/response.rb', line 13 def initialize(doc, parser = 'rexml') @doc = doc @parser = parser # namespaces for use in xpath queries # this is technically more correct and is required for # libxml to be able to parse the explain block. @namespaces = {'zs' => 'http://www.loc.gov/zing/srw/', 'ns0' => 'http://explain.z3950.org/dtd/2.0/'} end |
Instance Attribute Details
#doc ⇒ Object (readonly)
Returns the value of attribute doc.
9 10 11 |
# File 'lib/sru/response.rb', line 9 def doc @doc end |
#namespaces ⇒ Object (readonly)
Returns the value of attribute namespaces.
11 12 13 |
# File 'lib/sru/response.rb', line 11 def namespaces @namespaces end |
#parser ⇒ Object (readonly)
Returns the value of attribute parser.
10 11 12 |
# File 'lib/sru/response.rb', line 10 def parser @parser end |