Class: SRU::Term
Overview
a class for representing a term in the response from a sru server
Instance Attribute Summary collapse
-
#display_term ⇒ Object
Returns the value of attribute display_term.
-
#extra_term_data ⇒ Object
Returns the value of attribute extra_term_data.
-
#number_of_records ⇒ Object
Returns the value of attribute number_of_records.
-
#value ⇒ Object
Returns the value of attribute value.
-
#where_in_list ⇒ Object
Returns the value of attribute where_in_list.
Attributes inherited from Response
Instance Method Summary collapse
-
#initialize(element) ⇒ Term
constructor
A new instance of Term.
Methods included from XPath
#get_attribute, #xpath, #xpath_all, #xpath_first
Constructor Details
#initialize(element) ⇒ Term
Returns a new instance of Term.
8 9 10 11 12 13 14 15 |
# File 'lib/sru/term.rb', line 8 def initialize(element) super element @value = xpath(@doc, 'value') @number_of_records = xpath(@doc, 'numberOfRecords') @display_term = xpath(@doc, 'displayTerm') @where_in_list = xpath(@doc, 'whereInList') @extra_term_data = xpath_first(@doc, 'extraTermData') end |
Instance Attribute Details
#display_term ⇒ Object
Returns the value of attribute display_term.
5 6 7 |
# File 'lib/sru/term.rb', line 5 def display_term @display_term end |
#extra_term_data ⇒ Object
Returns the value of attribute extra_term_data.
5 6 7 |
# File 'lib/sru/term.rb', line 5 def extra_term_data @extra_term_data end |
#number_of_records ⇒ Object
Returns the value of attribute number_of_records.
5 6 7 |
# File 'lib/sru/term.rb', line 5 def number_of_records @number_of_records end |
#value ⇒ Object
Returns the value of attribute value.
5 6 7 |
# File 'lib/sru/term.rb', line 5 def value @value end |
#where_in_list ⇒ Object
Returns the value of attribute where_in_list.
5 6 7 |
# File 'lib/sru/term.rb', line 5 def where_in_list @where_in_list end |