Sha256: 9cbb5c03f4303d136499c13955a4b7ec703e9048aea09269f2bbf80171043858

Contents?: true

Size: 529 Bytes

Versions: 3

Compression:

Stored size: 529 Bytes

Contents

module Puree

  module XMLExtractor

    # Identifier mixin.
    #
    module IdentifierMixin

      # @return [Array<Model::Identifier>]
      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

    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
puree-2.9.2 lib/puree/xml_extractor/mixins/identifier_mixin.rb
puree-2.9.1 lib/puree/xml_extractor/mixins/identifier_mixin.rb
puree-2.9.0 lib/puree/xml_extractor/mixins/identifier_mixin.rb