Class: IsoDoc::CC::Metadata

Inherits:
Generic::Metadata
  • Object
show all
Defined in:
lib/isodoc/cc/metadata.rb

Instance Method Summary collapse

Constructor Details

#initialize(lang, script, labels) ⇒ Metadata

Returns a new instance of Metadata.



11
12
13
14
# File 'lib/isodoc/cc/metadata.rb', line 11

def initialize(lang, script, 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 author(isoxml, _out)
  tc = isoxml.at(ns("//bibdata/ext/editorialgroup/committee"))
  set(:tc, tc.text) if tc
  super
end

#configurationObject



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
35
36
37
38
39
40
41
42
# File 'lib/isodoc/cc/metadata.rb', line 31

def personal_authors(isoxml)
  persons = {}
  roles = isoxml.xpath(ns("//bibdata/contributor/role/@type")).
    inject([]) { |m, t| m << t.value }
  roles.uniq.sort.each do |r|
    names = isoxml.xpath(ns("//bibdata/contributor[role/@type = '#{r}']"\
                              "/person"))
    persons[r] = extract_person_names_affiliations(names) unless names.empty?
  end
  set(:roles_authors_affiliations, persons)
  super
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']"))&.text
  set(:doctitle, main)
end