Class: IsoDoc::Acme::Metadata
- Inherits:
-
Metadata
- Object
- Metadata
- IsoDoc::Acme::Metadata
- Defined in:
- lib/isodoc/acme/metadata.rb
Class Attribute Summary collapse
-
._file ⇒ Object
Returns the value of attribute _file.
Class Method Summary collapse
Instance Method Summary collapse
- #author(isoxml, _out) ⇒ Object
- #baselocation(loc) ⇒ Object
- #configuration ⇒ Object
-
#initialize(lang, script, labels) ⇒ Metadata
constructor
A new instance of Metadata.
- #stage_abbr(status) ⇒ Object
- #unpublished(status) ⇒ Object
Constructor Details
#initialize(lang, script, labels) ⇒ Metadata
Returns a new instance of Metadata.
7 8 9 10 11 12 |
# File 'lib/isodoc/acme/metadata.rb', line 7 def initialize(lang, script, labels) super here = File.dirname(__FILE__) default_logo_path = File.(File.join(here, "html", "logo.jpg")) set(:logo, baselocation(configuration.logo_path) || default_logo_path) end |
Class Attribute Details
._file ⇒ Object
Returns the value of attribute _file.
15 16 17 |
# File 'lib/isodoc/acme/metadata.rb', line 15 def _file @_file end |
Class Method Details
.inherited(k) ⇒ Object
18 19 20 |
# File 'lib/isodoc/acme/metadata.rb', line 18 def self.inherited( k ) k._file = caller_locations.first.absolute_path end |
Instance Method Details
#author(isoxml, _out) ⇒ Object
31 32 33 34 35 |
# File 'lib/isodoc/acme/metadata.rb', line 31 def (isoxml, _out) super tc = isoxml.at(ns("//bibdata/ext/editorialgroup/committee")) set(:tc, tc.text) if tc end |
#baselocation(loc) ⇒ Object
22 23 24 25 |
# File 'lib/isodoc/acme/metadata.rb', line 22 def baselocation(loc) return nil if loc.nil? File.(File.join(File.dirname(self.class::_file || __FILE__), "..", "..", "..", loc)) end |
#configuration ⇒ Object
27 28 29 |
# File 'lib/isodoc/acme/metadata.rb', line 27 def configuration Metanorma::Acme.configuration end |
#stage_abbr(status) ⇒ Object
37 38 39 40 |
# File 'lib/isodoc/acme/metadata.rb', line 37 def stage_abbr(status) return super unless configuration.stage_abbreviations Hash(configuration.stage_abbreviations).dig(status) end |
#unpublished(status) ⇒ Object
42 43 44 45 |
# File 'lib/isodoc/acme/metadata.rb', line 42 def unpublished(status) stages = configuration&.published_stages || ["published"] !(Array(stages).map { |m| m.downcase }.include? status.downcase) end |