Class: EAC::Person::Biography

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#abstractObject (readonly)

Returns the value of attribute abstract.



70
71
72
# File 'lib/eac.rb', line 70

def abstract
  @abstract
end

#notesObject (readonly)

Returns the value of attribute notes.



70
71
72
# File 'lib/eac.rb', line 70

def notes
  @notes
end