class IsoDoc::Csand::Metadata
A {Converter} implementation that generates CSAND output, and a document schema encapsulation of the document for validation
Public Class Methods
new(lang, script, labels)
click to toggle source
Calls superclass method
# File lib/isodoc/csand/metadata.rb, line 8 def initialize(lang, script, labels) super set(:status, "XXX") end
Public Instance Methods
docid(isoxml, _out)
click to toggle source
# File lib/isodoc/csand/metadata.rb, line 29 def docid(isoxml, _out) docnumber = isoxml.at(ns("//bibdata/docidentifier")) docstatus = isoxml.at(ns("//bibdata/status")) dn = docnumber&.text if docstatus set(:status, status_print(docstatus.text)) abbr = status_abbr(docstatus.text) dn = "#{dn}(#{abbr})" unless abbr.empty? end set(:docnumber, dn) end
status_abbr(status)
click to toggle source
# File lib/isodoc/csand/metadata.rb, line 45 def status_abbr(status) case status when "working-draft" then "wd" when "committee-draft" then "cd" when "draft-standard" then "d" else "" end end
status_print(status)
click to toggle source
# File lib/isodoc/csand/metadata.rb, line 41 def status_print(status) status.split(/-/).map{ |w| w.capitalize }.join(" ") end
subtitle(_isoxml, _out)
click to toggle source
# File lib/isodoc/csand/metadata.rb, line 18 def subtitle(_isoxml, _out) nil end
title(isoxml, _out)
click to toggle source
# File lib/isodoc/csand/metadata.rb, line 13 def title(isoxml, _out) main = isoxml&.at(ns("//title[@language='en']"))&.text set(:doctitle, main) end