Class: NDLSearch::Item
- Inherits:
-
Object
- Object
- NDLSearch::Item
- Defined in:
- lib/ndl_search.rb
Instance Attribute Summary collapse
-
#resource ⇒ Object
Returns the value of attribute resource.
Instance Method Summary collapse
-
#initialize(xml) ⇒ Item
constructor
A new instance of Item.
- #ndc ⇒ Object
- #permalink ⇒ Object
- #title ⇒ Object
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
#resource ⇒ Object
Returns the value of attribute resource.
44 45 46 |
# File 'lib/ndl_search.rb', line 44 def resource @resource end |
Instance Method Details
#ndc ⇒ Object
58 59 60 |
# File 'lib/ndl_search.rb', line 58 def ndc @ndc ||= @resource.get_text('dc:subject[@xsi:type="dcndl:NDC9"]') end |
#permalink ⇒ Object
54 55 56 |
# File 'lib/ndl_search.rb', line 54 def permalink @guid ||= @resource.get_text('guid') end |
#title ⇒ Object
50 51 52 |
# File 'lib/ndl_search.rb', line 50 def title @title ||= @resource.get_text('title') end |