Method: WCID::Hit#initialize

Defined in:
lib/wcid/hit.rb

#initialize(m) ⇒ Hit

Hit objects contain some potentially useful information, but of primary interest to me is the lccn which allows you to grab the authority record of a particular hit.



16
17
18
19
20
21
22
23
24
# File 'lib/wcid/hit.rb', line 16

def initialize m
  @score = m.attributes['score']
  @established_form = m.elements["establishedForm"].text if m.elements["establishedForm"]
  @uri = m.elements['uri'].text if m.elements['uri']
  @citation = m.elements['citation'].text if m.elements['citation']
  @lccn = m.elements['lccn'].text if m.elements['lccn']
  @pubdates = m.elements['pubDates'].text if m.elements['pubDates']
  @name_type = m.elements['nameType'].text if m.elements['nameType']
end