class IsoDoc::Sample::Metadata
Constants
- MONTHS
Public Class Methods
new(lang, script, labels)
click to toggle source
Calls superclass method
# File lib/isodoc/sample/metadata.rb, line 7 def initialize(lang, script, labels) super here = File.dirname(__FILE__) set(:logo, File.expand_path(File.join(here, "html", "logo.jpg"))) end
Public Instance Methods
monthyr(isodate)
click to toggle source
# File lib/isodoc/sample/metadata.rb, line 49 def monthyr(isodate) m = /(?<yr>\d\d\d\d)-(?<mo>\d\d)/.match isodate return isodate unless m && m[:yr] && m[:mo] return "#{MONTHS[m[:mo].to_sym]} #{m[:yr]}" end
security(isoxml, _out)
click to toggle source
# File lib/isodoc/sample/metadata.rb, line 55 def security(isoxml, _out) security = isoxml.at(ns("//bibdata/ext/security")) || return set(:security, security.text) end
status_abbr(status)
click to toggle source
# File lib/isodoc/sample/metadata.rb, line 18 def status_abbr(status) case status when "working-draft" then "wd" when "committee-draft" then "cd" when "draft-standard" then "d" else "" end end
version(isoxml, _out)
click to toggle source
Calls superclass method
# File lib/isodoc/sample/metadata.rb, line 28 def version(isoxml, _out) super revdate = get[:revdate] set(:revdate_monthyear, monthyr(revdate)) end