Class: IsoDoc::Iho::Metadata

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

Instance Method Summary collapse

Instance Method Details

#configurationObject



7
8
9
# File 'lib/isodoc/iho/metadata.rb', line 7

def configuration
  Metanorma::Iho.configuration
end

#series(xml, _out) ⇒ Object



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

def series(xml, _out)
  set(:series, xml.at(ns("//bibdata/series[@type = 'main']/title"))&.text)
  a = xml.at(ns("//bibdata/series[@type = 'main']/abbreviation"))&.text and
    set(:seriesabbr, a)
end

#title(isoxml, _out) ⇒ Object



22
23
24
25
26
27
28
# File 'lib/isodoc/iho/metadata.rb', line 22

def title(isoxml, _out)
  set(:doctitle, isoxml.at(ns("//bibdata/title[@type='main']"))
                              &.children&.to_xml || "")
  %w(main appendix annex part supplement).each do |e|
    t = title1(isoxml, e) and set("#{e}title".to_sym, t)
  end
end

#title1(xml, type) ⇒ Object



17
18
19
20
# File 'lib/isodoc/iho/metadata.rb', line 17

def title1(xml, type)
  xml.at(ns("//bibdata/title[@type='title-#{type}']"))
    &.children&.to_xml
end