Class: IsoDoc::CC::Metadata
- Inherits:
-
Generic::Metadata
- Object
- Generic::Metadata
- IsoDoc::CC::Metadata
- Defined in:
- lib/isodoc/cc/metadata.rb
Instance Method Summary collapse
- #author(isoxml, _out) ⇒ Object
- #configuration ⇒ Object
-
#initialize(lang, script, locale, labels) ⇒ Metadata
constructor
A new instance of Metadata.
- #personal_authors(isoxml) ⇒ Object
- #roles_authors_affiliations(isoxml) ⇒ Object
- #subtitle(_isoxml, _out) ⇒ Object
- #title(isoxml, _out) ⇒ Object
Constructor Details
#initialize(lang, script, locale, labels) ⇒ Metadata
Returns a new instance of Metadata.
11 12 13 14 |
# File 'lib/isodoc/cc/metadata.rb', line 11 def initialize(lang, script, locale, labels) super set(:tc, "XXXX") end |
Instance Method Details
#author(isoxml, _out) ⇒ Object
25 26 27 28 29 |
# File 'lib/isodoc/cc/metadata.rb', line 25 def (isoxml, _out) tc = isoxml.at(ns("//bibdata/ext/editorialgroup/committee")) set(:tc, tc.text) if tc super end |
#configuration ⇒ Object
7 8 9 |
# File 'lib/isodoc/cc/metadata.rb', line 7 def configuration Metanorma::CC.configuration end |
#personal_authors(isoxml) ⇒ Object
31 32 33 34 |
# File 'lib/isodoc/cc/metadata.rb', line 31 def (isoxml) set(:roles_authors_affiliations, (isoxml)) super end |
#roles_authors_affiliations(isoxml) ⇒ Object
36 37 38 39 40 41 42 43 44 |
# File 'lib/isodoc/cc/metadata.rb', line 36 def (isoxml) isoxml.xpath(ns("//bibdata/contributor/role/@type")) .inject([]) { |m, t| m << t.value } .uniq.sort.each_with_object({}) do |r, m| names = isoxml.xpath(ns("//bibdata/contributor[role/@type = '#{r}']"\ "/person")) names.empty? or m[r] = extract_person_names_affiliations(names) end end |
#subtitle(_isoxml, _out) ⇒ Object
21 22 23 |
# File 'lib/isodoc/cc/metadata.rb', line 21 def subtitle(_isoxml, _out) nil end |
#title(isoxml, _out) ⇒ Object
16 17 18 19 |
# File 'lib/isodoc/cc/metadata.rb', line 16 def title(isoxml, _out) main = isoxml.at(ns("//bibdata/title[@language='en']"))&.children&.to_xml set(:doctitle, main) end |