Sha256: 48b60a7ef04bed6ec03879ca884cd96f2cf60f96cb8169544e9b84c37f9acaec

Contents?: true

Size: 836 Bytes

Versions: 23

Compression:

Stored size: 836 Bytes

Contents

require "isodoc"
require "metanorma-iso"

module IsoDoc
  module Iec
    class  Metadata < IsoDoc::Iso::Metadata
      def docstatus(isoxml, _out)
        docstatus = isoxml.at(ns("//bibdata/status/stage"))
        substage = isoxml.at(ns("//bibdata/status/substage"))
        set(:unpublished, false)
        if docstatus
          set(:stage, docstatus.text)
          set(:stage_int, docstatus.text.to_i)
          set(:unpublished, unpublished(docstatus.text))
          set(:statusabbr, substage["abbreviation"])
          unpublished(docstatus.text) and
            set(:stageabbr, docstatus["abbreviation"])
        end
        revdate = isoxml.at(ns("//version/revision-date"))
        set(:revdate, revdate&.text)
      end

      def unpublished(status)
        status.to_i > 0 && status.to_i < 60
      end
    end
  end
end

Version data entries

23 entries across 20 versions & 2 rubygems

Version Path
metanorma-iec-1.2.8 lib/isodoc/iec/metadata.rb
metanorma-iec-1.2.7 lib/isodoc/iec/metadata.rb
metanorma-iec-1.2.6 lib/isodoc/iec/metadata.rb
metanorma-iec-1.2.5 lib/isodoc/iec/metadata.rb
metanorma-iec-1.2.4 lib/isodoc/iec/metadata.rb
metanorma-iec-1.2.2 lib/isodoc/iec/metadata.rb
metanorma-cli-1.3.4 gems/ruby/2.6.0/gems/metanorma-iec-1.2.1/lib/isodoc/iec/metadata.rb
metanorma-cli-1.3.4 gems/ruby/2.6.0/gems/metanorma-iec-1.1.3/lib/isodoc/iec/metadata.rb
metanorma-cli-1.3.4 gems/ruby/2.6.0/gems/metanorma-iec-1.1.2/lib/isodoc/iec/metadata.rb
metanorma-iec-1.2.1 lib/isodoc/iec/metadata.rb
metanorma-iec-1.2.0 lib/isodoc/iec/metadata.rb
metanorma-cli-1.3.3.1 gems/ruby/2.6.0/gems/metanorma-iec-1.1.2/lib/isodoc/iec/metadata.rb
metanorma-cli-1.3.3.1 gems/ruby/2.6.0/gems/metanorma-iec-1.1.3/lib/isodoc/iec/metadata.rb
metanorma-iec-1.1.3 lib/isodoc/iec/metadata.rb
metanorma-iec-1.1.2 lib/isodoc/iec/metadata.rb
metanorma-iec-1.1.1 lib/isodoc/iec/metadata.rb
metanorma-iec-1.1.0 lib/isodoc/iec/metadata.rb
metanorma-iec-1.0.9 lib/isodoc/iec/metadata.rb
metanorma-iec-1.0.8 lib/isodoc/iec/metadata.rb
metanorma-iec-1.0.7 lib/isodoc/iec/metadata.rb