Class: EAC::Person
Defined Under Namespace
Classes: Name
Instance Method Summary collapse
-
#initialize(xml_doc) ⇒ Person
constructor
A new instance of Person.
- #names ⇒ Object
- #names_from_entries ⇒ Object
Constructor Details
#initialize(xml_doc) ⇒ Person
34 35 36 |
# File 'lib/eac.rb', line 34 def initialize(xml_doc) super end |
Instance Method Details
#names ⇒ Object
38 39 40 41 42 43 |
# File 'lib/eac.rb', line 38 def names if @names.nil? @names = names_from_entries end @names end |
#names_from_entries ⇒ Object
45 46 47 48 49 50 51 52 53 |
# File 'lib/eac.rb', line 45 def names_from_entries name_elements = [] name_entries = @xml.xpath("//ns:cpfDescription/ns:identity/ns:nameEntry", ns:'urn:isbn:1-931666-33-4') name_entries.each do |entry| name_elements << Name.new(entry) end name_elements end |