Class: IsoDoc::Iec::Metadata

Inherits:
IsoDoc::Iso::Metadata
  • Object
show all
Defined in:
lib/isodoc/iec/metadata.rb

Instance Method Summary collapse

Instance Method Details

#docfunction(isoxml) ⇒ Object



34
35
36
37
38
39
40
41
42
43
# File 'lib/isodoc/iec/metadata.rb', line 34

def docfunction(isoxml)
  b = isoxml&.at(ns("//bibdata/ext/function#{NOLANG}"))&.text || return
  b and set(:function, status_print(b))
  b1 = isoxml&.at(ns("//bibdata/ext/function#{currlang}"))&.text || b
  b1 and set(:function_display, status_print(b1))
  b1 = isoxml&.at(ns("//bibdata/ext/function[@language = 'en']"))&.text || b
  b1 and set(:function_en, status_print(b1))
  b1 = isoxml&.at(ns("//bibdata/ext/function[@language = 'fr']"))&.text || b
  b1 and set(:function_fr, status_print(b1))
end

#dochorizontal(isoxml) ⇒ Object



45
46
47
48
49
50
51
52
53
54
# File 'lib/isodoc/iec/metadata.rb', line 45

def dochorizontal(isoxml)
  b = isoxml&.at(ns("//bibdata/ext/horizontal#{NOLANG}"))&.text || return
  b and set(:horizontal, status_print(b))
  b1 = isoxml&.at(ns("//bibdata/ext/horizontal#{currlang}"))&.text
  b1 and set(:horizontal_display, status_print(b1))
  b1 = isoxml&.at(ns("//bibdata/ext/horizontal[@language = 'en']"))&.text
  b1 and set(:horizontal_en, status_print(b1))
  b1 = isoxml&.at(ns("//bibdata/ext/horizontal[@language = 'fr']"))&.text
  b1 and set(:horizontal_fr, status_print(b1))
end

#docstatus(isoxml, _out) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/isodoc/iec/metadata.rb', line 7

def docstatus(isoxml, _out)
  docstatus = isoxml.at(ns("//bibdata/status/stage"))
  substage = isoxml.at(ns("//bibdata/status/substage"))
  set(:unpublished, false)
  if docstatus
    set(:stage, docstatus.text)
    set(:stage_int, docstatus.text.to_i)
    set(:unpublished, unpublished(docstatus.text))
    set(:statusabbr, substage["abbreviation"])
    unpublished(docstatus.text) and
      set(:stageabbr, docstatus["abbreviation"])
  end
  revdate = isoxml.at(ns("//bibdata/version/revision-date"))
  set(:revdate, revdate&.text)
end

#doctype(isoxml, _out) ⇒ Object



23
24
25
26
27
28
29
30
31
32
# File 'lib/isodoc/iec/metadata.rb', line 23

def doctype(isoxml, _out)
  super
  b = isoxml&.at(ns("//bibdata/ext/doctype#{NOLANG}"))&.text
  b1 = isoxml&.at(ns("//bibdata/ext/doctype[@language = 'en']"))&.text || b
  b1 and set(:doctype_en, status_print(b1))
  b1 = isoxml&.at(ns("//bibdata/ext/doctype[@language = 'fr']"))&.text || b
  b1 and set(:doctype_fr, status_print(b1))
  docfunction(isoxml)
  dochorizontal(isoxml)
end

#unpublished(status) ⇒ Object



56
57
58
# File 'lib/isodoc/iec/metadata.rb', line 56

def unpublished(status)
  status.to_i > 0 && status.to_i < 60
end