Sha256: 5f8fa1f047506de1765a06dde8affe44433261cd0828b321421f84ee9270ab7d

Contents?: true

Size: 764 Bytes

Versions: 8

Compression:

Stored size: 764 Bytes

Contents

module Relaton
  module Render
    module Bipm
      class Parse < ::Relaton::Render::Parse
        def simple_or_host_xml2hash(doc, host)
          ret = super
          ret.merge(home_standard: home_standard(doc, ret[:publisher_raw]))
        end

        def home_standard(_doc, pubs)
          pubs&.any? do |r|
            ["International Organization for Standardization", "ISO",
             "International Electrotechnical Commission", "IEC"]
              .include?(r[:nonpersonal])
          end
        end

        def authoritative_identifier(doc)
          if %w(article journal book).include?(doc.type)
            [] # we don't want BIPM identifiers for these!
          else
            super
          end
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
metanorma-bipm-2.6.2 lib/relaton/render/parse.rb
metanorma-bipm-2.6.1 lib/relaton/render/parse.rb
metanorma-bipm-2.6.0 lib/relaton/render/parse.rb
metanorma-bipm-2.5.12 lib/relaton/render/parse.rb
metanorma-bipm-2.5.11 lib/relaton/render/parse.rb
metanorma-bipm-2.5.10 lib/relaton/render/parse.rb
metanorma-bipm-2.5.9 lib/relaton/render/parse.rb
metanorma-bipm-2.5.8 lib/relaton/render/parse.rb