Class: Metanorma::Compile::RelatonDrop

Inherits:
Liquid::Drop
  • Object
show all
Defined in:
lib/metanorma/compile/relaton_drop.rb

Instance Method Summary collapse

Constructor Details

#initialize(relaton_data) ⇒ RelatonDrop



8
9
10
# File 'lib/metanorma/compile/relaton_drop.rb', line 8

def initialize(relaton_data)
  @relaton = relaton_data
end

Instance Method Details

#dateObject



20
21
22
# File 'lib/metanorma/compile/relaton_drop.rb', line 20

def date
  at("./date/on")
end

#docidentifierObject



12
13
14
# File 'lib/metanorma/compile/relaton_drop.rb', line 12

def docidentifier
  at("./docidentifier")
end

#languageObject



28
29
30
# File 'lib/metanorma/compile/relaton_drop.rb', line 28

def language
  at("./language")
end

#publisherObject



24
25
26
# File 'lib/metanorma/compile/relaton_drop.rb', line 24

def publisher
  at("./contributor[role/@type = 'publisher']/organization/name")
end

#scriptObject



32
33
34
# File 'lib/metanorma/compile/relaton_drop.rb', line 32

def script
  at("./script")
end

#slugifyObject



40
41
42
43
44
45
# File 'lib/metanorma/compile/relaton_drop.rb', line 40

def slugify
  docidentifier&.downcase
    &.gsub(/[^a-z0-9]+/, "-")
    &.gsub(/-+/, "-")
    &.gsub(/^-|-$/, "")
end

#titleObject



16
17
18
# File 'lib/metanorma/compile/relaton_drop.rb', line 16

def title
  at("./title")
end

#versionObject



36
37
38
# File 'lib/metanorma/compile/relaton_drop.rb', line 36

def version
  at("./version")
end