Class: Metanorma::Compile::RelatonDrop
- Inherits:
-
Liquid::Drop
- Object
- Liquid::Drop
- Metanorma::Compile::RelatonDrop
- Defined in:
- lib/metanorma/compile/relaton_drop.rb
Instance Method Summary collapse
- #date ⇒ Object
- #docidentifier ⇒ Object
-
#initialize(relaton_data) ⇒ RelatonDrop
constructor
A new instance of RelatonDrop.
- #language ⇒ Object
- #publisher ⇒ Object
- #script ⇒ Object
- #slugify ⇒ Object
- #title ⇒ Object
- #version ⇒ Object
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
#date ⇒ Object
20 21 22 |
# File 'lib/metanorma/compile/relaton_drop.rb', line 20 def date at("./date/on") end |
#docidentifier ⇒ Object
12 13 14 |
# File 'lib/metanorma/compile/relaton_drop.rb', line 12 def docidentifier at("./docidentifier") end |
#language ⇒ Object
28 29 30 |
# File 'lib/metanorma/compile/relaton_drop.rb', line 28 def language at("./language") end |
#publisher ⇒ Object
24 25 26 |
# File 'lib/metanorma/compile/relaton_drop.rb', line 24 def publisher at("./contributor[role/@type = 'publisher']/organization/name") end |
#script ⇒ Object
32 33 34 |
# File 'lib/metanorma/compile/relaton_drop.rb', line 32 def script at("./script") end |
#slugify ⇒ Object
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 |
#title ⇒ Object
16 17 18 |
# File 'lib/metanorma/compile/relaton_drop.rb', line 16 def title at("./title") end |
#version ⇒ Object
36 37 38 |
# File 'lib/metanorma/compile/relaton_drop.rb', line 36 def version at("./version") end |