Class: EAC::Person::Name

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

Defined Under Namespace

Classes: Part

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(xml) ⇒ Name

Returns a new instance of Name.



58
59
60
61
62
63
64
# File 'lib/eac.rb', line 58

def initialize(xml)
  @parts = []
  xml_parts = xml.xpath('ns:part', ns:'urn:isbn:1-931666-33-4')
  xml_parts.each do |part_data|
    @parts << Part.new(part_data)
  end
end

Instance Attribute Details

#partsObject (readonly)

Returns the value of attribute parts.



56
57
58
# File 'lib/eac.rb', line 56

def parts
  @parts
end

Instance Method Details

#to_sObject



66
67
68
# File 'lib/eac.rb', line 66

def to_s
  @parts.map(&:text).join(', ')
end