Class: EAC::Person::Biography
- Inherits:
-
Object
- Object
- EAC::Person::Biography
- Defined in:
- lib/eac.rb
Instance Attribute Summary collapse
-
#abstract ⇒ Object
readonly
Returns the value of attribute abstract.
-
#notes ⇒ Object
readonly
Returns the value of attribute notes.
Instance Method Summary collapse
-
#initialize(xml) ⇒ Biography
constructor
A new instance of Biography.
Constructor Details
#initialize(xml) ⇒ Biography
Returns a new instance of Biography.
71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/eac.rb', line 71 def initialize(xml) @notes = xml.xpath('//ns:biogHist/ns:p', ns:'urn:isbn:1-931666-33-4').map(&:text) xml_result = xml.xpath('//ns:biogHist/ns:abstract', ns:'urn:isbn:1-931666-33-4') if xml_result.empty? @abstract = "" else @abstract = xml_result.map(&:text).join('\n') end end |
Instance Attribute Details
#abstract ⇒ Object (readonly)
Returns the value of attribute abstract.
70 71 72 |
# File 'lib/eac.rb', line 70 def abstract @abstract end |
#notes ⇒ Object (readonly)
Returns the value of attribute notes.
70 71 72 |
# File 'lib/eac.rb', line 70 def notes @notes end |