Class: EAC::Person::Name
- Inherits:
-
Object
- Object
- EAC::Person::Name
- Defined in:
- lib/eac.rb
Defined Under Namespace
Classes: Part
Instance Attribute Summary collapse
-
#parts ⇒ Object
readonly
Returns the value of attribute parts.
Instance Method Summary collapse
-
#initialize(xml) ⇒ Name
constructor
A new instance of Name.
- #to_s ⇒ Object
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
#parts ⇒ Object (readonly)
Returns the value of attribute parts.
56 57 58 |
# File 'lib/eac.rb', line 56 def parts @parts end |
Instance Method Details
#to_s ⇒ Object
66 67 68 |
# File 'lib/eac.rb', line 66 def to_s @parts.map(&:text).join(', ') end |