Sha256: 3d72682326760e34da85cecc86f3e9487689124512f9728f579c04fa0744945f

Contents?: true

Size: 715 Bytes

Versions: 15

Compression:

Stored size: 715 Bytes

Contents

module Puree

  module XMLExtractor

    # Journal XML extractor.
    #
    class Journal < Puree::XMLExtractor::Resource
      include Puree::XMLExtractor::PublisherMixin

      def initialize(xml)
        super
        setup_model :journal
      end

      # @return [String, nil]
      def issn
        xpath_query_for_single_value '/issns/issn'
      end

      # @return [String, nil]
      def title
        xpath_query_for_single_value '/titles/title'
      end

      private

      def combine_metadata
        super
        @model.issn = issn
        @model.publisher = publisher
        @model.title = title
        @model
      end

      def xpath_root
        '/journal'
      end

    end

  end

end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
puree-2.9.2 lib/puree/xml_extractor/journal.rb
puree-2.9.1 lib/puree/xml_extractor/journal.rb
puree-2.9.0 lib/puree/xml_extractor/journal.rb
puree-2.8.1 lib/puree/xml_extractor/journal.rb
puree-2.8.0 lib/puree/xml_extractor/journal.rb
puree-2.7.0 lib/puree/xml_extractor/journal.rb
puree-2.6.0 lib/puree/xml_extractor/journal.rb
puree-2.5.1 lib/puree/xml_extractor/journal.rb
puree-2.5.0 lib/puree/xml_extractor/journal.rb
puree-2.4.0 lib/puree/xml_extractor/journal.rb
puree-2.3.0 lib/puree/xml_extractor/journal.rb
puree-2.2.0 lib/puree/xml_extractor/journal.rb
puree-2.1.1 lib/puree/xml_extractor/journal.rb
puree-2.1.0 lib/puree/xml_extractor/journal.rb
puree-2.0.0 lib/puree/xml_extractor/journal.rb