Module: Puree::XMLExtractor::IdentifierMixin
Overview
Identifier mixin.
Instance Method Summary collapse
Instance Method Details
#identifiers ⇒ Array<Model::Identifier>
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/puree/xml_extractor/mixins/identifier_mixin.rb', line 10 def identifiers xpath_result = xpath_query '/ids/id' data = [] xpath_result.each do |d| identifier = Puree::Model::Identifier.new identifier.id = d.xpath('value').text.strip identifier.type = d.xpath('type/term/text').text.strip data << identifier end data.uniq { |d| d.id } end |