Class: NDLSearch::Item

Inherits:
Object
  • Object
show all
Defined in:
lib/ndl_search.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(xml) ⇒ Item

Returns a new instance of Item.



46
47
48
# File 'lib/ndl_search.rb', line 46

def initialize(xml)
  @resource = xml
end

Instance Attribute Details

#resourceObject

Returns the value of attribute resource.



44
45
46
# File 'lib/ndl_search.rb', line 44

def resource
  @resource
end

Instance Method Details

#ndcObject



58
59
60
# File 'lib/ndl_search.rb', line 58

def ndc
  @ndc ||= @resource.get_text('dc:subject[@xsi:type="dcndl:NDC9"]')
end


54
55
56
# File 'lib/ndl_search.rb', line 54

def permalink
  @guid ||=  @resource.get_text('guid')
end

#titleObject



50
51
52
# File 'lib/ndl_search.rb', line 50

def title
  @title ||= @resource.get_text('title')
end