Class: Stepmod::Utils::Converters::ModuleRef

Inherits:
ReverseAdoc::Converters::Base
  • Object
show all
Defined in:
lib/stepmod/utils/converters/module_ref.rb

Instance Method Summary collapse

Instance Method Details

#convert(node, _state = {}) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/stepmod/utils/converters/module_ref.rb', line 7

def convert(node, _state = {})
  ref = node['linkend']
  # #23:
  # In this case when we see this:

  # <module_ref linkend="product_as_individual:3_definition">individual products</module_ref>
  # We take the text value of the element and convert to this:

  # term:[individual products]
  if node['linkend'].split(':').length > 1
    ref = node.text
  end
  " term:[#{normalized_ref(ref)}] "
end