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.



62
63
64
65
66
67
68
# File 'lib/eac.rb', line 62

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.



60
61
62
# File 'lib/eac.rb', line 60

def parts
  @parts
end

Instance Method Details

#to_sObject



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

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