Class: Jats::Affiliation

Inherits:
Node
  • Object
show all
Defined in:
lib/jats/affiliation.rb

Instance Attribute Summary

Attributes inherited from Node

#index, #xml

Instance Method Summary collapse

Methods inherited from Node

#attributes, from_xml, index_for, #initialize, #name, reset_indices, #type

Constructor Details

This class inherits a constructor from Jats::Node

Instance Method Details

#to_hashObject



3
4
5
6
7
8
9
10
# File 'lib/jats/affiliation.rb', line 3

def to_hash
  {
    label:      xml.css('label').text,
    department: xml.css('institution').text.gsub(/^\W+|\W+$/, ''),
    address:    xml.css('addr-line').text,
    country:    xml.css('country').text
  }
end