Sha256: 8f0acb57c87c0791968deafe99ac6b175e2d01441b642ceac064996dd79431a3

Contents?: true

Size: 658 Bytes

Versions: 1

Compression:

Stored size: 658 Bytes

Contents

require "metanorma-iso"

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

        def home_standard(_doc, pubs)
          pubs&.any? do |r|
            ["International Organization for Standardization", "ISO",
             "International Electrotechnical Commission", "IEC",
             "一般財団法人 日本規格協会", "JIS"]
              .include?(r[:nonpersonal])
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
metanorma-jis-0.3.0 lib/relaton/render-jis/parse.rb