Class: SRU::Term

Inherits:
Response show all
Defined in:
lib/sru/term.rb

Overview

a class for representing a term in the response from a sru server

Instance Attribute Summary collapse

Attributes inherited from Response

#doc, #namespaces, #parser

Instance Method Summary collapse

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_termObject

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_dataObject

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_recordsObject

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

#valueObject

Returns the value of attribute value.



5
6
7
# File 'lib/sru/term.rb', line 5

def value
  @value
end

#where_in_listObject

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